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
相关推荐
时艰.1 小时前
分布式事务在电商项目中的应用
java·分布式
飞火流星020271 小时前
验证kafka队列中的数据是否是被压缩后的数据
分布式·kafka·验证kafka队列中的数据格式·验证kafka数据压缩·验证kafka数据是否已被压缩
Anastasiozzzz1 小时前
解决 RabbitMQ 的可靠性投递与消息重复消费问题思路
分布式·rabbitmq
Coder_Boy_2 小时前
技术交流总结:分布式、数据库、Spring及SpringBoot核心知识点梳理
数据库·spring boot·分布式·spring·微服务
shanchahua1234562 小时前
解冻支付功能-分布式数据一致性(分布式事务)
分布式
Coder_Boy_2 小时前
技术交流总结:分布式、数据库、Spring及SpringBoot核心知识点梳理(实现参考)
数据库·spring boot·分布式·spring·架构
小程故事多_802 小时前
详解Kafka重平衡与分区重分配,核心差异、原理及实操辨析
分布式·kafka·linq
七夜zippoe2 小时前
性能测试实战:Locust负载测试框架深度指南
分布式·python·性能测试·locust·性能基准
飞火流星020272 小时前
kafka设置数据压缩的方式及作用
分布式·kafka·kafka数据压缩·kafka压缩配置级别·kafka数里压缩配置作用·kafka数据压缩配置级别
没有bug.的程序员16 小时前
Gradle 构建优化深度探秘:从 Java 核心到底层 Android 物理性能压榨实战指南
android·java·开发语言·分布式·缓存·gradle