centOS系统下zookeeper集群部署

1、Install 

将zookeeper.XXX.tar.gz 解压到指定的路径,如/usr/local/src

2、config

我们集群中提供相同应用的服务群称为quorum,其中的每台机器都有相同的配置文件

2.1)mkdir -p /var/zookeeper/data (可以指定系统中分配较大的空间分区)

2.2)编辑config文件(安装根目录下的conf目录下)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.
dataDir=/tmp/zookeeper
maxClientCnxns=100
# the port at which the clients will connect
clientPort=2181
server.1=服务ip:2555:3555
server.2=服务ip:2555:3555
server.3=服务ip:2555:3555

其中server.x代表整个集群的机器,当服务启动时,会在数据目录(上面的data目录)下

查找命名位myid的文件。

2.3)配置myid文件

在数据目录下创建名为myid(不要带任何扩展属性)的文件,根据server.x在对应的

ip机器上的myid文件中填入对应的编号(譬如,server123.1,则在ip为server123的

机器上的myid文件中填上1)

3、注意配置centOS上的防火墙端口

查看防火墙状态  service iptables status

关闭防火墙 service iptables  stop

或者通过配置文件方式添加对应的端口(鉴于篇幅不赘述)

4、启动集群中的机器

三台主机执行 zkServer.sh   start启动,注意三台启动的间隔时间

不要太长(因为有超时设定)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值