zookeeper安装
一、下载安装:
1、环境准备:
ZooKeeper服务器是用Java创建的,它运行在JVM之上。需要安装JDK 7或更高版本。
2、下载:
3、安装:
创建安装目录
mkdir /opt/zookeeper
将文件上传到服务器
进入安装目录
cd /opt/zookeeper
解压压缩包
tar -zxvf apache-zookeeper-3.5.6-bin.tar.gz
复制并重命名解压文件
cp -r apache-zookeeper-3.5.6-bin zookeeper2181
4、配置启动
进入到conf目录拷贝一个zoo_sample.cfg并完成配置
cd conf
#拷贝
cp zoo_sample.cfg zoo.cfg
修改zoo.cfg
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=/tmp/zookeeper # the port at which the clients will connect clientPort=2181 # 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
进入编辑模式
a/i
修改数据存放目录:
dataDir=/opt/zookeeper/zookeeper2181/zkdata
退出编辑模式:
esc键
保存退出:
:wq 回车
5.启动ZooKeeper
进入bin目录:
cd /opt/zookeeper/zookeeper2181/bin
启动:
./zkServer.sh start
查看状态:
./zkServer.sh status
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 上周热点回顾(2.17-2.23)
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)
· spring官宣接入deepseek,真的太香了~