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
相关推荐
2603_954708313 小时前
全维度容错设计,打造微电网安全运行屏障
服务器·网络·数据库·人工智能·分布式·安全
国服第二切图仔4 小时前
HarmonyOS APP《画伴梦工厂》开发第60篇-分布式软总线2.0——多设备协同新范式
分布式·wpf·harmonyos
952365 小时前
RabbitMQ-基础操作
java·spring boot·分布式·后端·spring·rabbitmq
2501_942389556 小时前
特斯拉的车辆摄像头每四天为AI训练集采集的数据量
人工智能·hadoop·zookeeper·oracle·时序数据库·memcache
worilb8 小时前
Spring Cloud 学习与实践(13):使用 Seata 解决分布式事务问题
分布式·学习·spring cloud
风若飞10 小时前
Tomcat 9.0.118 分布式 Redis Session 配置指南
redis·分布式·tomcat
六bring个六10 小时前
文件互传在传输层的操作分析
分布式·p2p·c/c++·open harmony
豆瓣鸡11 小时前
Leaf 分布式 ID 生成实战——美团 Leaf 从原理到落地
java·spring boot·分布式
牛奶咖啡1311 小时前
大数据Hadoop运维应用实践——Hadoop大数据平台基础与架构(hadoop伪分布式的安装部署)
大数据·hadoop·分布式·hadoop是什么?有啥用?·hadoop的适用与不适用场景·hadoop伪分布式的安装部署·hadoop分布式存储操作
吴声子夜歌12 小时前
Redis 5.x——分布式锁
redis·分布式