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
相关推荐
CRUD酱16 小时前
微服务分模块后怎么跨模块访问资源
java·分布式·微服务·中间件·java-ee
回家路上绕了弯17 小时前
定时任务实战指南:从单机到分布式,覆盖Spring Scheduler/Quartz/XXL-Jo
分布式·后端
rchmin18 小时前
开源分布式ID生成方案接入介绍
分布式·开源
西***634718 小时前
赋能指挥中枢:分布式KVM坐席协作系统技术与应用
分布式
Tony Bai19 小时前
【分布式系统】01 为何分布式?—— Vibe Coding 时代的系统设计哲学与我们的远征地图
分布式
云技纵横20 小时前
订票系统高并发实战:基于 ZooKeeper 的分布式锁、选座与幂等回滚(Java/Curator)
分布式·zookeeper·java-zookeeper
disgare21 小时前
关于分布式系统 RPC 中高可用功能的实现
java·分布式
小马爱打代码21 小时前
Kafka 偏移量(Offset):消费者如何记住消费位置?
分布式·kafka
a努力。21 小时前
中国电网Java面试被问:分布式缓存的缓存穿透解决方案
java·开发语言·分布式·缓存·postgresql·面试·linq
sheji341621 小时前
【开题答辩全过程】以 基于Hadoop教育平台的设计与实现为例,包含答辩的问题和答案
大数据·hadoop·分布式