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
相关推荐
未若君雅裁3 小时前
Redis 分布式锁与 Redisson:从抢券超卖讲到 WatchDog、可重入和 RedLock
redis·分布式
一只普通的码农4 小时前
Filebeat 在windows环境部署并结合kafka使用
分布式·kafka
covco5 小时前
AI 原生营销矩阵系统:分布式架构设计与核心模块实现
人工智能·分布式·矩阵
Java识堂6 小时前
Kafka 如何保证消息的可靠性投递?
分布式·kafka
gQ85v10Db7 小时前
Redis分布式锁进阶第三十二篇
数据库·redis·分布式
gQ85v10Db7 小时前
Redis分布式锁进阶第三十篇
数据库·redis·分布式
爱吃苹果的梨叔7 小时前
2026年清虹分布式坐席系统如何破局技术内卷与运维成本困局
运维·分布式
heimeiyingwang7 小时前
【架构实战】分布式事务Seata-AT:解决跨服务数据一致性的终极方案
分布式·架构
摇滚侠17 小时前
Redis 秒杀功能 超卖问题 一人一单问题 分布式锁 精彩!精彩!
redis·分布式·bootstrap
笨鸟先飞的橘猫19 小时前
MMO游戏中的“跨服团队副本”匹配与状态同步系统
分布式·学习·游戏·lua·skynet