shell脚本一键部署kibana
2019-05-17 11:25
549 查看
#!/bin/bash #配置Kibana的安装目录 修改的地方1 脚本可以自己创建 currentTime=$(date '+%Y-%m-%d %H:%M:%S') echo -e "请输入kibana的安装目录,不存在脚本自动创建,例如 /bigdata/install" read kibanainstallpath #创建Kibana安装的目录 if [ ! -d $kibanainstallpath ]; then mkdir -p $kibanainstallpath fi if [ ! -d $kibanainstallpath ]; then echo "创建目录$kibanainstallpath失败!请检查目录是否有权限" exit fi #解压tar包 currentdir=$(cd $(dirname $0); pwd) ls | grep 'kibana-.*[gz]$' if [ $? -ne 0 ]; then #当前目录没有es的压缩包 echo "在$currentdir下没有发现kibana-*.tar.gz,请自行上传!" exit else #解压 tar -zxvf $currentdir/$(ls | grep 'kibana-.*[gz]$') -C $kibanainstallpath fi kibanabanben=`ls $kibanainstallpath| grep 'kibana-.*'` #PATH设置 #末行插入 echo "">>~/.bash_profile echo "#kibana $currentTime">>~/.bash_profile echo "export KIBANA_HOME=$esinstallpath/$esbanben">>~/.bash_profile echo 'export PATH=$PATH:$KIBANA_HOME/bin'>>~/.bash_profile source ~/.bash_profile confpath=$kibanainstallpath/$kibanabanben/config #修改配置文件 echo -e "请输入您的主机ip:例如 192.168.8.21" read serverip echo "elasticsearch.url: \"http://${serverip}:9200\"" >>$confpath/kibana.yml echo -e "请输入kibana的访问端口:例如 5601" read kibanaport echo "server.port: ${kibanaport}">>$confpath/kibana.yml echo 'server.host: "0.0.0.0"'>>$confpath/kibana.yml echo 'kibana.index: ".kibana"'>>$confpath/kibana.yml
相关文章推荐
- 单台主机一键编译部署LAMP+wordpress+discuz系统的shell脚本
- shell脚本一键部署环境
- 使用Shell脚本一键部署Hadoop
- 基于Shell脚本的Linux下Javaweb项目一键部署
- shell自动化一键部署脚本,秒级一键回滚脚本
- CentOS下nginx一键安装shell脚本
- 快速部署tomcat项目的Shell脚本
- Shell脚本-自动化部署WEB
- Jenkins使用shell脚本部署到远程服务器步骤
- 用shell脚本一键搭建LNMP环境实战
- Linux管理的艺术--Shell脚本一键搞定(二)
- 服务器部署shell脚本
- 使用shell和expect一键批量分发SSH密钥脚本
- Shell脚本分享:DebianLNMP一键安装服务器套件
- Linux平台Shell脚本部署Openstack配置文件
- 安装完Ubuntu后通过shell脚本一键安装软件
- 自动下载源码_并编译_打包_部署_重启服务的Shell脚本
- shell脚本一键安装nginx
- 【自动构建系列】自动部署环境的shell脚本