linux搭建zookeeper集群

linux搭建zookeeper集群

  1. 安装jdk 看我上个文章

  2. 创建文件夹 mkdir zookeeper

  3. 用Xftp上传文件夹到zookeeper

  4. 在zookeeper-3.4.14文件夹创建data,logs文件夹

  5. 在data文件夹新增myid文件,里面维护你机器的编号

  6. 把conf文件夹里面的zoo_sample.cfg修改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.
#server2、server3文件夹下的这个文件 要修改这个位置
dataDir=/root/ff/zookeeper/zookeeper-3.4.14/data/1
#日志输出位置,根据个人喜好 将三个server的日志分开或者放在一个目录
dataLogDir=/root/ff/zookeeper/zookeeper-3.4.14/logs
# the port at which the clients will connect
clientPort=2182
server.1=192.168.229.128:2888:3888
server.2=192.168.229.129:2888:3888
server.3=192.168.229.130:2888:3888
# 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
  1. 执行/root/ff/zookeeper/zookeeper-3.4.14/bin/zkServer.sh start启动ZK
  2. 执行/root/ff/zookeeper/zookeeper-3.4.14/bin/zkServer.sh status 查看启动状态
    如图,启动成功

ZK下载地址:链接:https://pan.baidu.com/s/1jdmsYj7w11kGI7odNUjaUQ
提取码:9vj0
报错:-bash: ./zkServer.sh: 权限不够
解决:执行chmod a+xwr zkServer.sh
报错:Error contacting service. It is probably not running.
解决:关闭防火墙(注意!!!)
systemctl status firewalld查看当前防火墙状态。
systemctl stop firewalld关闭当前防火墙。
systemctl disable firewalld开机防火墙不启动。
一个具有注脚的文本。1


  1. 如有疑问欢迎大家加我QQ:577128460 ↩︎

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值