ZooKeeper单机模式入门

一、下载ZooKeeper
http://zookeeper.apache.org/doc/trunk/zookeeperStarted.html#sc_Download
二、单机模式使用Zookeeper
1.解压ZooKeeper tar包;
2.在解压后的目录里,创建conf/zoo.cfg,设置好关键配置
tickTime
the basic time unit in milliseconds used by ZooKeeper. It is used to do heartbeats and the minimum session timeout will be twice the tickTime.

dataDir
the location to store the in-memory database snapshots and, unless specified otherwise, the transaction log of updates to the database.

clientPort
the port to listen for client connections

3.启动ZooKeeper Server
bin/zkServer.sh start

4.客户端连接ZooKeeper Server
bin/zkCli.sh -server 127.0.0.1:2181
接着通过help查看可用的操作命令;

猜你喜欢

转载自zhong9257.iteye.com/blog/2265327