1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| mkdir -p /export/servers tar -zxvf apache-zookeeper-3.5.5-bin.tar.gz -C /export/servers/ mv /export/servers/apache-zookeeper-3.5.5-bin /export/servers/zookeeper cp /export/servers/zookeeper/conf/zoo_sample.cfg /export/servers/zookeeper/conf/zoo.cfg
vi /export/servers/zookeeper/conf/zoo.cfg tickTime=2000 initLimit=10 syncLimit=5 dataDir=/export/data/zookeeper/ dataLogDir=/export/log/zookeeper/ clientPort=2181 maxClientCnxns=1000 autopurge.snapRetainCount=3 autopurge.purgeInterval=2 server.0=172.26.10.167:2888:3888 server.1=172.26.10.168:2888:3888 server.2=172.26.10.169:2888:3888
vi /export/servers/zookeeper/conf/java.env #!/bin/bash export JAVA_HOME=/export/servers/jdk1.8.0_192/ export JVMFLAGS="-Xms1024m -Xmx2048m $JVMFLAGS"
vi /export/servers/zookeeper/bin/zkEnv.sh
(修改下面的参数zookeeper.out存储路径)
ZOO_LOG_DIR="/export/log/zookeeper/"
上述操作在三台主机上都执行,或者直接拷贝。
第1机器创建相应文件夹
mkdir /export/data/zookeeper/ mkdir /export/log/zookeeper/ echo "0" > /export/data/zookeeper/myid
第2机器创建相应文件夹
mkdir /export/data/zookeeper/ mkdir /export/log/zookeeper/ echo "1" > /export/data/zookeeper/myid
第3机器创建相应文件夹
mkdir /export/data/zookeeper/ mkdir /export/log/zookeeper/ echo "2" > /export/data/zookeeper/myid
|