首页 > 其他 > 详细

CentOS下安装zookeeper

时间:2016-01-27 00:49:48      阅读:284      评论:0      收藏:0      [点我收藏+]

Linux下安装Zookeeper集群步骤

(1) 下载zookeeper安装包

  地址:http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz

(2) 解压安装包并放置在对应的路径下

  解压对应文件到对应的路径下,本文将zookeeper解压到/soft/zk路径下,并在zk路径下建立 dataDir与dataLogDir路径

  cd /soft/zk

  tar -xvf zookeeper-xxx.tar.gz

  mkdir dataDir

  mkdir dataLogDir

 

(3) 配置zookeeper的配置文件

  对zookeeper进行配置

  cd /soft/zk/zookeeper-xxx/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. dataDir=/soft/zk/dataDir dataLogDir=/soft/zk/dataLogDir # the port at which the clients will connect clientPort=2181 server.1=192.168.1.111:2888:3888 server.2=192.168.1.112:2888:3888 server.3=192.168.1.113:2888:3888

这里对zookeeper服务器进行配置,这里需要将myid与对应的服务器编号对应

 

(4) 设置zookeeper对应的myid文件

  cd /soft/zk/dataDir

  vim myid

  将服务器编号放入

 

(5) 启动zookeeper服务

  cd /soft/zk/zookeeper-xxx/bin

  sh zkServer.sh start

  启动服务,注意查看zookeeper.out这个日志输出,可以看到问题点

 

(6) 验证zookeeper是否正常启动

  cd /soft/zk/zookeeper-xxx/bin

  sh zkServer.sh status

  sh zkCli.sh -server 192.168.1.111:2181

 

(7) 查询zookeeper服务器对应的主从关系状态

  cd /soft/zk/zookeeper-xxx/bin

  sh zkServer.sh status

CentOS下安装zookeeper

原文:http://www.cnblogs.com/rainy-shurun/p/5161950.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!