Kafka Eagle启动脚本(start-kafkaeagle)
cd /usr/local/bin
sudo vi start-kafkaeagle
脚本内容如下:
#!/bin/bash
KE_HOME=/home/vagrant/modules/kafka-eagle-web-1.4.7
echo "start kafka eagle-------------------------------------------------"
for i in bigdata-node3
do
ssh $i "source /etc/profile;${KE_HOME}/bin/ke.sh start"
done
sleep 3s
jpsx
exit 0
设置脚本执行权限:
sudo chmod +x start-kafkaeagle
sudo chown vagrant:vagrant start-kafkaeagle
Kafka Eagle停止脚本(stop-kafkaeagle)
cd /usr/local/bin
sudo vi stop-kafkaeagle
脚本内容如下:
#!/bin/bash
KE_HOME=/home/vagrant/modules/kafka-eagle-web-1.4.7
echo "stop kafka eagle"
for i in bigdata-node3
do
ssh $i "source /etc/profile;${KE_HOME}/bin/ke.sh stop"
done
sleep 3s
jpsx
exit 0
设置脚本执行权限:
sudo chmod +x stop-kafkaeagle
sudo chown vagrant:vagrant stop-kafkaeagle
Kafak Eagle查看脚本(status-_kafkaeagle)_
cd /usr/local/bin
sudo vi status-kafkaeagle
脚本内容如下:
#!/bin/bash
KE_HOME=/home/vagrant/modules/kafka-eagle-web-1.4.7
echo "kafka eagle status------------------------------------------------"
for i in bigdata-node3
do
echo ------------------- $i --------------
ssh $i "source /etc/profile;${KE_HOME}/bin/ke.sh status"
done
exit 0
设置脚本执行权限:
sudo chmod +x status-kafkaeagle
sudo chown vagrant:vagrant status-kafkaeagle
分发(选做):
# 使用root账户分发至其他节点
sudo scp -r /usr/local/bin/*-kafkaeagle root@bigdata-node2:/usr/local/bin/
sudo scp -r /usr/local/bin/*-kafkaeagle root@bigdata-node3:/usr/local/bin/