赞
踩
自行下载安装包 zookeeper-3.4.6.tar.gz
wget http://apache.fayea.com/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
安装步骤:
1.解压 zookeeper-3.4.6.tar.gz 到 /root 目录下
2.在目录 /root/zookeeper-3.4.6.tar.gz/conf 中新增文件 zoo.cfg
3.创建目录 /root/zookeeper-3.4.6/data
4.创建目录 /root/zookeeper-3.4.6/logs
5.执行启动命令 sh zkServer.sh start
ZooKeeper服务命令:
在准备好相应的配置之后,可以直接通过zkServer.sh 这个脚本进行服务的相关操作
设置开机启动
编辑文件: vi /etc/rc.local
追加内容: /root/zookeeper-3.4.6/bin/zkServer.sh start
提升权限:chmod +x /etc/rc.local
保存文件结束
zoo.cfg文件内容如下
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/root/zookeeper-3.4.6/data
dataLogDir=/root/zookeeper-3.4.6/logs
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
autopurge.snapRetainCount=2
# Purge task interval in hours
# Set to "0" to disable auto purge feature
autopurge.purgeInterval=1
#2888,3888 are election port
#server.1=192.168.0.101:2888:3888
#server.2=192.168.0.102:2888:3888
#server.3=192.168.0.103:2888:3888
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。