1.問題:
群起腳本啟動后查看jps沒有出現:QuorumPeerMain
Zookeeper正常啟動但是群起腳本查狀態出現:Error contacting service. It is probably not running錯誤
ZooKeeper JMX enabled by default Using config: /opt/module/zookeeper-3.4.10/bin/../conf/zoo.cfg Error contacting service. It is probably not running.
2.原因:
腳本沒有加上source /etc/profile;
3.正確腳本:(僅供參考,請指正)
#! /bin/bash case $1 in "start"){ for i in hadoop201 hadoop202 hadoop203 do ssh $i "source /etc/profile;/opt/module/zookeeper-3.4.10/bin/zkServer.sh start" done };; "stop"){ for i in hadoop201 hadoop202 hadoop203 do ssh $i "/opt/module/zookeeper-3.4.10/bin/zkServer.sh stop" done };; "status"){ for i in hadoop201 hadoop202 hadoop203 do ssh $i "source /etc/profile;/opt/module/zookeeper-3.4.10/bin/zkServer.sh status" done };; esac