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
相关推荐
weixin_445476683 小时前
从“用框架”到“控系统”———架构通用能力(模块边界、分层设计、缓存策略、事务一致性、分布式思维)
分布式·缓存·架构
Mr.wangh4 小时前
Redis作为分布式锁
数据库·redis·分布式
小马爱打代码4 小时前
分布式锁:Redisson的公平锁
分布式
Z_z在努力8 小时前
【rabbitmq 高级特性】RabbitMQ 延迟队列全面解析
分布式·rabbitmq
没有bug.的程序员8 小时前
分布式缓存架构:从原理到生产实践
java·分布式·缓存·架构·分布式缓存架构
满满的好奇9 小时前
Mesh网络技术深度解析:从分布式拓扑到复杂场景落地
分布式
会开花的二叉树10 小时前
分布式文件存储 RPC 服务实现
c++·分布式·网络协议·rpc
文艺倾年10 小时前
【八股消消乐】手撕分布式协议和算法(基础篇)
分布式·算法
jc062010 小时前
4.3-中间件之Kafka
分布式·中间件·kafka
2351610 小时前
【并发编程】详解volatile
java·开发语言·jvm·分布式·后端·并发编程·原理