TA的每日心情 | 奋斗 2019-12-27 16:56 |
---|
签到天数: 14 天 [LV.3]偶尔看看II
中级会员
- 积分
- 289
|
下载地址: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
|
|