欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 财经 > 产业 > centos7安装单机zookeeper

centos7安装单机zookeeper

2025/4/3 10:40:37 来源:https://blog.csdn.net/Linging_24/article/details/146434111  浏览:    关键词:centos7安装单机zookeeper

下载安装包并解压:apache-zookeeper-3.4.14-bin.tar.gz

#解压
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配置:

#进入配置目录
cd /usr/local/kafka/zookeeper-3.4.14/conf/
#复制配置文件
cp zoo_sample.cfg zoo.cfg
#编辑配置文件,如下

单机版配置:

# 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:

#进入bin目录
cd /usr/local/kafka/zookeeper-3.4.14/bin
#启动
./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/kafka/zookeeper-3.4.14/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
#查看启动状态
./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/kafka/zookeeper-3.4.14/bin/../conf/zoo.cfg
Mode: standalone

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词