Kafka Eagle启动脚本(start-kafkaeagle)

  1. cd /usr/local/bin
  2. sudo vi start-kafkaeagle

脚本内容如下:

  1. #!/bin/bash
  2. KE_HOME=/home/vagrant/modules/kafka-eagle-web-1.4.7
  3. echo "start kafka eagle-------------------------------------------------"
  4. for i in bigdata-node3
  5. do
  6. ssh $i "source /etc/profile;${KE_HOME}/bin/ke.sh start"
  7. done
  8. sleep 3s
  9. jpsx
  10. exit 0

设置脚本执行权限:

  1. sudo chmod +x start-kafkaeagle
  2. sudo chown vagrant:vagrant start-kafkaeagle

Kafka Eagle停止脚本(stop-kafkaeagle)

  1. cd /usr/local/bin
  2. sudo vi stop-kafkaeagle

脚本内容如下:

  1. #!/bin/bash
  2. KE_HOME=/home/vagrant/modules/kafka-eagle-web-1.4.7
  3. echo "stop kafka eagle"
  4. for i in bigdata-node3
  5. do
  6. ssh $i "source /etc/profile;${KE_HOME}/bin/ke.sh stop"
  7. done
  8. sleep 3s
  9. jpsx
  10. exit 0

设置脚本执行权限:

  1. sudo chmod +x stop-kafkaeagle
  2. sudo chown vagrant:vagrant stop-kafkaeagle

Kafak Eagle查看脚本(status-_kafkaeagle)_

  1. cd /usr/local/bin
  2. sudo vi status-kafkaeagle

脚本内容如下:

  1. #!/bin/bash
  2. KE_HOME=/home/vagrant/modules/kafka-eagle-web-1.4.7
  3. echo "kafka eagle status------------------------------------------------"
  4. for i in bigdata-node3
  5. do
  6. echo ------------------- $i --------------
  7. ssh $i "source /etc/profile;${KE_HOME}/bin/ke.sh status"
  8. done
  9. exit 0

设置脚本执行权限:

  1. sudo chmod +x status-kafkaeagle
  2. sudo chown vagrant:vagrant status-kafkaeagle

分发(选做):

  1. # 使用root账户分发至其他节点
  2. sudo scp -r /usr/local/bin/*-kafkaeagle root@bigdata-node2:/usr/local/bin/
  3. sudo scp -r /usr/local/bin/*-kafkaeagle root@bigdata-node3:/usr/local/bin/