【Zookeeper】zookeeper安装说明

编程

1.介绍
2.安装
   2.1 下载
         地址:http://www.apache.org/dyn/closer.cgi/zookeeper/
         选定版本下载: wget http://mirrors.hust.edu.cn/apache/zookeeper/
                                   tar -zxvf zookeeper-3.3.6.tar.gz -C /usr/local
                                   mv zookeeper-3.3.6.tar.gz  zookeeper
   2.2 配置
         2.2.1  环境变量配置
         vim  ~/.bash_profile
         export ZOOKEEPER_HOME=/usr/local/zookeeper
         export PATH=.:$JAVA_HOME/bin:$ZOOKEEPER_HOME/bin:$KAFKA_HOME/bin:$PATH
         source ~/.bash_profile
3.运行配置
3.1 单机模式配置
       进入zookeeper配置目录,cd /usr/local/zookeeper/conf
       复制添加zoo.cfg配置文件  cp zoo.sample.cfg  zoo.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.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
【参数说明】
tickTime: zookeeper中使用的基本时间单位, 毫秒值.
dataDir: 数据目录. 可以是任意目录.
dataLogDir: log目录, 同样可以是任意目录. 如果没有设置该参数, 将使用和dataDir相同的设置.
clientPort: 监听client连接的端口号.
至此, zookeeper的单机模式已经配置好了. 启动server只需运行脚本:
./bin/zkServer.sh start 
Server启动之后, 就可以启动client连接server了, 执行脚本:    
./bin/zkCli.sh -server localhost:2181

3.2 伪分布式模式
3.3 集群模式 
2.资料
zookeeper原理
 http://cailin.iteye.com/blog/2014486

Zookeeper 开发者手册
http://note.youdao.com/share/?id=099cca6d6b2d4bfc1dd1e8267b7381c3&type=note

Zookeeper的安装和配置
http://coolxing.iteye.com/blog/1871009

以上是 【Zookeeper】zookeeper安装说明 的全部内容, 来源链接: utcz.com/z/517057.html

回到顶部