elasticsearch集成kibana的集群脚本
#!/bin/bash
es_home=/opt/module/elasticsearch
kibana_home=/opt/module/kibana
case $1 in
"start") {
for i in hadoop102 hadoop103 hadoop104;
do
echo "=============== $i starting ES ==============="
ssh $i "source /etc/profile;${es_home}/bin/elasticsearch > /dev/null 2>&1 &"
done
echo "=============== starting kibana =============="
nohup ${
kibana_home}/bin/kibana >${
kibana_home}/logs/kibana.log 2>&1 &
};;
"stop") {
echo "=============== stoping kibana ==============="
ps -ef|grep ${
kibana_home} |grep -v grep|awk '{print $2}'|xargs kill
for i in hadoop102 hadoop103 hadoop104;
do
echo "=============== $i stoping ES ==============="
ssh $i "ps -ef | grep $es_home |grep -v grep|awk '{print \$2}'|xargs kill" >/dev/null 2>&1
done
};;
esac