【zookeeper】集群安装
1.解压(按照简单安装操作)
创新互联是一家专业提供八步企业网站建设,专注与成都网站设计、网站建设、H5页面制作、小程序制作等业务。10年已为八步众多企业、政府机构等服务。创新互联专业网站建设公司优惠进行中。
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
新闻标题:【zookeeper】集群安装
转载源于:http://ybzwz.com/article/poocsg.html