zookeeper集群安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zookeeper集群安装相关的知识,希望对你有一定的参考价值。
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: standalone
以上是关于zookeeper集群安装的主要内容,如果未能解决你的问题,请参考以下文章