下载Zookeeper-3.4.6.tar.gz 后解压

地址 http://www.apache.org/dist/zookeeper/

standalone 单机模式配置

复制zookeeper-3.4.6/conf/zoo_sample.cfg为zoo.cfg,zoo.cfg是zookeeper的默认配置文件

# 每次心跳间隔,单位ms
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
# 缓存数据目录
dataDir=/tmp/zookeeper
# 端口号
clientPort=2181

启动

zookeeper-3.4.6/bin/目录下执行

./zkServer.sh start

相关操作参数

{start|start-foreground|stop|restart|status|upgrade|print-cmd}

我有切糕
863 声望45 粉丝

Java架构师,技术经理