zk单机启动

博客介绍了使用的是最新版本的Zookeeper 3.6.0,并给出了下载链接http://zookeeper.apache.org/releases.html#download 。
1. 这里用的是最新版本的zookeeper3.6.0 -> http://zookeeper.apache.org/releases.html#download
1. 首先解压
tar -zxf apache-zookeeper-3.6.0-bin.tar.gz
2. 修改conf目录
cp zoo_sample.cfg zoo.cfg
vim 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.
# 存储快照的目录。不要使用/tmp存储,/tmp这里只是示例sakes。
dataDir=/root/zk3.6/data

# 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.
# 在打开autopurge之前,请务必阅读管理员指南的维护部分。
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
# 要在dataDir中保留的快照数
#autopurge.snapRetainCount=3

# Purge task interval in hours
# Set to "0" to disable auto purge feature
# 清除任务间隔(以小时为单位)设置为“0”以禁用自动清除功能
#autopurge.purgeInterval=1

## Metrics Providers	度量提供者
#
# https://prometheus.io Metrics Exporter	度量导出器
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true
3. 切换到bin目录启动
./zkServer.sh start
./zkServer.sh status

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值