summaryrefslogtreecommitdiff
path: root/PCAP-PIC/zookeeper/bin/set_zk_env.sh
diff options
context:
space:
mode:
Diffstat (limited to 'PCAP-PIC/zookeeper/bin/set_zk_env.sh')
-rw-r--r--PCAP-PIC/zookeeper/bin/set_zk_env.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/PCAP-PIC/zookeeper/bin/set_zk_env.sh b/PCAP-PIC/zookeeper/bin/set_zk_env.sh
new file mode 100644
index 0000000..57774d9
--- /dev/null
+++ b/PCAP-PIC/zookeeper/bin/set_zk_env.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+echo -e "\n#zookeeper\nexport ZOOKEEPER_HOME=/home/tsg/olap/zookeeper-3.4.10\nexport PATH=\$ZOOKEEPER_HOME/bin:\$PATH" >> /etc/profile.d/zookeeper.sh
+chmod +x /etc/profile.d/zookeeper.sh
+
+keeppsth='/etc/init.d/keepzkalive'
+if [ -x $keeppsth ];then
+ chkconfig --add keepzkalive
+ chkconfig keepzkalive on
+ service keepzkalive start && sleep 5
+ zk_dae=`ps -ef | grep dae-zookeeper.sh | grep -v grep | wc -l`
+ if [ $zk_dae -eq "0" ];then
+ nohup /home/tsg/olap/zookeeper-3.4.10/bin/dae-zookeeper.sh > /dev/null 2>&1 &
+ fi
+fi
+