zk.sh:
#!/bin/bash
case $1 in
"start") {
for i in sc1 sc2 sc3
do
echo " ---------- $i ----------"
ssh $i "/opt/module/zookeeper-3.5.7/bin/zkServer.sh start"
done
};;
"stop") {
for i in sc1 sc2 sc3
do
echo " ---------- $i ----------"
ssh $i "/opt/module/zookeeper-3.5.7/bin/zkServer.sh stop"
done
};;
"status") {
for i in sc1 sc2 sc3
do
echo " ---------- $i ----------"
ssh $i "/opt/module/zookeeper-3.5.7/bin/zkServer.sh status"
done
};;
esac
Error: JAVA_HOME is not set and java could not be found in PATH.
解决:
在zookeeper-3.5.7/bin路径下zkEnv.sh
中指定环境:
添加:
JAVA_HOME=/usr/local/java/jdk1.8.0_361