学途无忧

标题: zookeeper高可用集群部署参考 [打印本页]

作者: wenji_tang    时间: 2019-11-28 13:05
标题: zookeeper高可用集群部署参考
下载地址:https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz
zk-01,zk-02,zk-03三个节点都执行
-------------------------------------------------------------------------------------
# tar xf /backup/packages/jdk-8u201-linux-x64.tar.gz -C /usr/local/
# vim jdk_env.sh
#!/bin/bash
# cd /backup/packages && tar xf jdk-8u201-linux-x64.tar.gz -C /usr/local/
# set java environment
cat <<EOF >> /etc/profile
export JAVA_HOME=/usr/local/jdk1.8.0_201
export CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
export PATH=\$JAVA_HOME/bin:\$PATH
EOF
source /etc/profile
# mkdir /app/zk/{data,log} -pv
# tar xf zookeeper-3.4.14.tar.gz -C /app/zk/ && cd /app/zk/zookeeper-3.4.14/conf
# cp -p zoo_sample.cfg zoo.cfg
# vim zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/app/zk/data
dataLogDir=/app/zk/log
clientPort=2181
server.1=zk-01:2888:3888
server.2=zk-02:2888:3888
server.3=zk-03:2888:3888
------------------------------------------------------------------------------------------------------------
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#master - zk-01echo "1">/app/zk/data/myid#slave1 - zk-02echo "2">/app/zk/data/myid#slave2 - zk-03echo "3">/app/zk/data/myid
----------------------------------------------------------------------------------------------------------
分别依次启动3个节点:zk-01,zk-02,zk-03
cd /app/zk/zookeeper-3.4.14/bin
./zkServer.sh start

加入开机启动
----------------------------------------------------------------------------------------------------------
vim /etc/rc.local
...
/home/scripts/zk.sh


作者: xigengyun    时间: 2020-11-9 10:54
啥也不说了,感谢楼主分享哇!




欢迎光临 学途无忧 (http://xuetu123.com/) Powered by Discuz! X3.2