分布式Zookeeper安装步骤:
1. 安装准备
1.2 解压缩到指定的目录下,比如:/opt/zookeeper下。
1.3 修改系统的hosts文件,指定域名映射。例如:
192.168.177.167 machine-1
192.168.177.168 machine-2
192.168.177.158 machine-0
三台机器中都安装Zookeeper服务。
2. 配置zookeeper
进入配置目录下,具体的命令如下:
[app@machine-1 conf]$ cd /opt/zookeeper/conf
复制模板配置文件:
[app@machine-1 conf]$ cp zoo_sample.cfg zoo.cfg
编辑文件:
[app@machine-1 conf]$ 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=/opt/zookeeper/data
# the directory where transaction log is stored.
# this parameter provides dedicated log device for ZooKeeper
dataLogDir=/opt/zookeeper/logs
# the port at which the clients will connect
clientPort=2222
server.1=machine-0:2888:3888
server.2=machine-1:2888:3888
server.3=machine-2:2888:3888
#
# 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
创建data和logs目录:
mkdir -p /opt/zookeeper/data
mkdir -p /opt/zookeeper/logs
3. 将zookeeper实例复制到集群
#机器machine-1上
scp -r /opt/zookeeper machine-0:/opt/
scp -r /opt/zookeeper machine-2:/opt/
添加myid文件到各台机器上,标示序列值不能够重复:
#一次输入1到225间的某个数,具体操作如下:
#machine-0
vim /opt/zookeeper/data/myid
1
#machine-1
vim /opt/zookeeper/data/myid
2
#machine-2
vim /opt/zookeeper/data/myid
3
启动各台机器的zookeeper。当然,可以将脚步添加到系统环境下,
直接执行sh脚步更方便,这里就不给出步骤了。
/opt/zookeeper/bin/zkServer.sh start
上实践本人已经运行成功了,有错误或者不足之处,请指出。
转载,请写明出处。乐意分享!
分享到:
相关推荐
需要三台机器安装zookeeper集群:安装JDK环境、安装部署zookeeper集群、启动zookeeper集群、修改配置
此附件是快速搭建zookeeper集群的脚本,方便灵活,减少了自己一大堆复杂的操作,像运行服务一样执行几条start,stop等命令即可轻松完成集群搭建。
zookeeper集群搭建
dubbo-zookeeper集群搭建,系统时间跟软件时间不一致解决方法,
zookeeper集群搭建手册配置指导
1.zookeeper 集群搭建 1. 在每个zookeeper的data目录下创建一个myid文件 文件的内容分别是1 2 3 这个文件 2. 在每个zook
centos7下Redis哨兵集群和kafka集群和zookeeper集群搭建 http://blog.csdn.net/gaowenhui2008/article/details/71516901 https://cwiki.apache.org/confluence/display/KAFKA/Clients
windows环境下zookeeper集群搭建,分别点击zookeeper目录下的bin\zkServer.cmd;java测试节点,删除和查询节点;
ZooKeeper集群搭建
linux下zookeeper集群环境搭建详细图文教程,简单易使用
搭建zookeeper集群搭建zookeeper集群搭建zookeeper集群搭建zookeeper集群搭建zookeeper集群搭建zookeeper集群
详细介绍了Zookerper注册中心集群搭建的准备工作以及搭建的详细步骤,并且模拟了集群的一些常见异常,可以使学习Zookeeper的同志们通过阅读本篇文档,能够快速上手对Zookeeper的搭建使用
zookeeper linux 搭建流程,zookeeper linux 搭建流程zookeeper linux 搭建流程zookeeper linux 搭建流程。
1.概述 2.快速部署 3.测试 1. 概述: 2.快速部署: 3.测试:
NULL 博文链接:https://xnbhnly.iteye.com/blog/2431757
实现zookeeper搭建单机集群,分机器搭建也可以。只要更改这个配置文件就可以了 start(){ sh /Users/mac/linuxsoft/zk-cluster/zookeeper-3.4.6/bin/zkServer.sh start /Users/mac/linuxsoft/zk-cluster/zookeeper...