您的位置:首页 > 其它

Zookeeper简单应用(单机)

2015-06-05 10:51 225 查看
简单的zookeeper单机安装部署,类似安装部署手册吧~

以sthe账户为例安装zookeeper

1. zookeeper安装包zookeeper-3.4.6.tar.gz上传至home目录下。(rz 命令 或者 secureFX工具)

2. 解压安装包

3. 配置文件修改

[sthe@server conf]$ vi zoo.cfg

# The number of milliseconds of each tick

# tickTime:这个时间是作为Zookeeper服务器之间或客户端与服务器之间维持心跳的时间间隔,也就是每个tickTime时间就会发送一个心跳。

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:Zookeeper保存数据的目录,默认情况下,Zookeeper将写数据的日志文件也保存在这个目录里。

#dataDir=/tmp/zookeeper 这个是默认的

dataDir=/home/sthe/zookeeper-3.4.6/data

# the port at which the clients will connect

#clientPort:这个端口就是客户端连接Zookeeper服务器的端口,Zookeeper会监听这个端口,接受客户端的访问请求。

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

保存退出配置就完了

启动:cd /home/sthe/zookeeper-3.4.6/bin 执行 ./zkServer.sh start

状态:./zkServer.sh status

关闭:./zkServer.sh stop

上个图:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: