cp -i zoo_sample.cfg zoo.cfg
当前目录列表
接着修改zoo.cfg文件
主要修改下民红框中几个地方,其它默认或者根据你自己的情况来修改
如果你全程都是跟着我的目录来的,直接像下面这样配置即可
#/opt/zookeeper/server1/zookeeper-3.4.10/conf/zoo.cfg
dataDir=/opt/zookeeper/server1/data
dataLogDir=/opt/zookeeper/server1/datalog
clientPort=2181
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889
#/opt/zookeeper/server2/zookeeper-3.4.10/conf/zoo.cfg
dataDir=/opt/zookeeper/server2/data
dataLogDir=/opt/zookeeper/server2/datalog
clientPort=2182
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889
#/opt/zookeeper/server3/zookeeper-3.4.10/conf/zoo.cfg
dataDir=/opt/zookeeper/server3/data
dataLogDir=/opt/zookeeper/server3/datalog
clientPort=2183
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889
配置完成,进入zookeeper的bin目录启动zk服务
cd /opt/zookeeper/server1/zookeeper-3.4.10/bin
./zkServer.sh start
cd /opt/zookeeper/server2/zookeeper-3.4.10/bin
./zkServer.sh start
cd /opt/zookeeper/server3/zookeeper-3.4.10/bin
./zkServer.sh start
启动信息
三个zk都启动完了后,jps确