1.解压(按照简单安装操作)
2.修改配置文件
vim 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=/usr/local/zookeeper/data dataLogDir=/usr/local/zookeeper/log # 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=3 # Purge task interval in hours # Set to "0" to disable auto purge feature #autopurge.purgeInterval=1 server.186=10.1.44.186:2888:3888 server.187=10.1.44.187:2888:3888 server.188=10.1.44.188:2888:3888
3.创建所需文件夹
mkdir -p /usr/local/zookeeper/data mkdir -p /usr/local/zookeeper/log
4.配置文件传输给其他zookeeper集群节点
scp zoo.cfg
5.创建myid标识文件(同上面server.186的尾号)
# 186 server cd /usr/local/zookeeper/data echo '186' > myid # 187 server cd /usr/local/zookeeper/data echo '187' > myid # 188 server cd /usr/local/zookeeper/data echo '188' > myid
6.启动
# 186 server /usr/local/zookeeper/bin/zkServer.sh start -------------- ZooKeeper JMX enabled by default Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg Starting zookeeper ... STARTED /usr/local/zookeeper/bin/zkServer.sh status -------------- ZooKeeper JMX enabled by default Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg Mode: follower # 187 server /usr/local/zookeeper/bin/zkServer.sh start -------------- ZooKeeper JMX enabled by default Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg Starting zookeeper ... STARTED /usr/local/zookeeper/bin/zkServer.sh status -------------- ZooKeeper JMX enabled by default Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg Mode: leader # 188 server /usr/local/zookeeper/bin/zkServer.sh start -------------- ZooKeeper JMX enabled by default Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg Starting zookeeper ... already running as process 1946. /usr/local/zookeeper/bin/zkServer.sh status -------------- ZooKeeper JMX enabled by default Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg Mode: follower
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。