zookeeper安装

最近在学习kafka,但是了解到,在学习kafka之前,一定要懂得zookeeper。也就是说,在linux系统中,安装kafka之前一定要保证机子上安装有zookeeper才行。

接下来就简单介绍一下zookeeper的安装过程。

1.在linux中安装zookeeper一定要选择这个包:apache-zookeeper-3.5.8-bin.tar.gz,不要选择apache-zookeeper-3.6.2.tar.gz这个安装包。

至于为什么这样选择,请参考网址:https://blog.csdn.net/u010411264/article/details/104706506

2.将apache-zookeeper-3.5.8-bin.tar.gz上传到linux系统/usr/local/目录下,紧接着对安装包进行解压。tar -zxvf apache-zookeeper-3.5.8-bin.tar.gz

3.将解压之后的文件夹改成zookeeper-3.5.8,当然,你不改也是可以的。

4.进入到zookeeper-3.5.8文件夹中,创建data文件夹。mkdir data

5.进入到/usr/local/zookeeper-3.5.8/conf/ 文件夹下面,复制zoo_sample.cfg文件,命名为zoo.cfg。 mv zoo_sample.cfg zoo.cfg (注意:这个步骤必须要操作的)

6.修改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-3.5.8/data
# the port at which the clients will connect
clientPort=2181
admin.serverPort=8888
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60

经过以上的操作步骤,zookeeper也就安装成功了。

我们可以进入到zookeeper的二进制可执行文件夹中,启动zookeeper,/usr/local/zookeeper-3.5.8/bin 

启动:./zkServer.sh start

查看进程:ps -ef | grep zookeeper

关闭:./zkServer.sh stop

 

posted on   ~码铃薯~  阅读(47)  评论(0编辑  收藏  举报

编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
历史上的今天:
2020-06-29 idea关联不上git
2020-06-29 parseBoolean Error

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示