zookeeper集群搭建-详细步骤

编程入门 行业动态 更新时间:2024-10-10 01:17:12

zookeeper<a href=https://www.elefans.com/category/jswz/34/1771240.html style=集群搭建-详细步骤"/>

zookeeper集群搭建-详细步骤

一:下载安装包:

apache-zookeeper-3.6.2-bin.百度网盘

链接:
提取码:0egb

复制这段内容后打开百度网盘手机App,操作更方便哦–来自百度网盘超级会员V4的分享

1:我在/opt创建module/zookeeper/目录

2:解压到module/zookeeper/目录下

tar -zxvf apache-zookeeper-3.6.2-bin.tar

再修改为

mv apache-zookeeper-3.6.2-bin.tar zookeeper-3.6.2

3:在上面解压的zookeeper-3.6.2下创建Data文件夹,然后创建myid文件,写入1

  • Data文件夹下
  • myid文件

4:进入conf文件夹内

1.将原始 zoo_sample.cfg 改为zoo.cfg
命令 mv zoo_sample.cfg zoo.cfg

2.进入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/module/zookeeper-3.6.2/Data
dataLogDir=/opt/module/zookeeper-3.6.2/logs
# the port at which the clients will connect
clientPort=2182
# 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.
#
# .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## Metrics Providers
#
## Metrics Providers
#
#  Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true
server.1=192.168.38.134:2888:3888
server.2=192.168.38.135:2888:3888
server.3=192.168.38.136:2888:3888

我踩过的坑:如果集群中先配置好一个,如果现在启动一个的话,虽然显示成功,但会有这样的提示,也就是还是失败的


把三个都搭好再一个一个启动


二:重复以上操作流程

1.我把第一台服务器上配置好的zookeeper,先通过xftp传到window,再,用xftp连接到另两台主机,然后复制拉倒同目录下

2.修改Data下myid文件,依次为2,3

3.第二台主机Data目录下的myid

4.输入命令启动成功后

5.第三台主机:

同样将主机Data目录下的myid修改为如下

6.启动成功后


附:

整个zookeeper-3.6.2文件夹里面内容

链接: 
提取码:u0lv 
复制这段内容后打开百度网盘手机App,操作更方便哦--来自百度网盘超级会员V4的分享

更多推荐

zookeeper集群搭建-详细步骤

本文发布于:2023-07-28 20:22:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1299861.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:集群   步骤   详细   zookeeper

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!