centos7安装单机zookeeper

下载安装包并解压:apache-zookeeper-3.4.14-bin.tar.gz

cmd 复制代码
#解压
tar -zxvf /usr/local/kafka/apache-zookeeper-3.4.14-bin.tar.gz
#重命名
mv apache-zookeeper-3.4.14-bin zookeeper-3.4.14  

修改zookeeper配置:

cmd 复制代码
#进入配置目录
cd /usr/local/kafka/zookeeper-3.4.14/conf/
#复制配置文件
cp zoo_sample.cfg zoo.cfg
#编辑配置文件,如下

单机版配置:

yml 复制代码
# 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

启动zookeeper:

cmd 复制代码
#进入bin目录
cd /usr/local/kafka/zookeeper-3.4.14/bin
#启动
./zkServer.sh start
xml 复制代码
ZooKeeper JMX enabled by default
Using config: /usr/local/kafka/zookeeper-3.4.14/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
cmd 复制代码
#查看启动状态
./zkServer.sh status
xml 复制代码
ZooKeeper JMX enabled by default
Using config: /usr/local/kafka/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: standalone
相关推荐
2501_933329558 小时前
企业舆情处置技术实践:基于AI的智能监测与申诉系统架构解析
人工智能·分布式·架构·系统架构
爱丽_12 小时前
Redis 分布式锁:SET NX、过期时间、续租、可重入、Redlock 与坑
数据库·redis·分布式
ok_hahaha15 小时前
java从头开始-黑马点评-分布式锁-redis实现基础版
java·redis·分布式
传感器与混合集成电路15 小时前
法珀干涉与光栅补偿:井下压力温度一体化光纤监测技术
分布式
@insist12316 小时前
数据库系统工程师-分布式数据库与数据仓库核心考点及应用体系
数据库·数据仓库·分布式·软考·数据库系统工程师·软件水平考试
XDHCOM17 小时前
TP5框架Redis分布式缓存实战,解决高并发场景下的数据一致性问题
redis·分布式·缓存
Fzuim17 小时前
从CLI到分布式智能体:重新理解AI Agent的演进路径与工程现实
人工智能·分布式·ai·agent·agentic
_院长大人_20 小时前
Spring Boot 3.3 + Atomikos 分布式事务日志路径配置踩坑记录
spring boot·分布式·后端
Data 实验室20 小时前
TaskPyro “小龙虾版本”专业爬虫管理平台来了:AI+分布式+IM 机器人,一套搞定企业级爬虫调度
人工智能·分布式·爬虫
想你依然心痛20 小时前
HarmonyOS 5.0教育行业解决方案:基于分布式能力的沉浸式智慧课堂系统
分布式·wpf·harmonyos