标签:
mkdir /usr/local/zookeeper
chown -R -v tomcat /usr/local/zookeeper
tar -xvf zookeeper-3.4.6.tar.gz
cp zoo_sample.cfg zoo.cfg
修改文件存储目录
dataDir=/usr/local/zookeeper/zookeeper-3.4.6/data
dataLogDir=/usr/local/zookeeper/zookeeper-3.4.6/logs
修改服务访问端口
clientPort=2181
配用户环境变量
export ZOOKEEPER_HOME=/usr/local/zookeeper/zookeeper-3.4.6
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH
集群环境建立servieid 文件,每台服务器独立设置
echo "1" > /usr/local/zookeeper/zookeeper-3.4.6/data/myid
echo "2" > /usr/local/zookeeper/zookeeper-3.4.6/data/myid
配置文件调整zoo.conf,加入:
server.1=192.168.1.231:2310:2330
server.2=192.168.1.233:2310:2330
启动:zkServer.sh start
查看状态:zkServer.sh status
停止:zkServer.sh stop
客户端链接:zkCli.sh -server 127.0.0.1:2181
http://www.cnblogs.com/ilovexiao/p/3946547.html
标签:
原文地址:http://www.cnblogs.com/kaye0110/p/5069741.html