Chinaunix首页 | 论坛 | 博客
  • 博客访问: 108349
  • 博文数量: 22
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 190
  • 用 户 组: 普通用户
  • 注册时间: 2015-01-20 16:59
个人简介

重点关注互联网、分布式、消息队列、优秀的开源框架,向企业类架构方向发展

文章分类

全部博文(22)

文章存档

2015年(22)

我的朋友

分类: 架构设计与优化

2015-01-27 15:29:52

1.集群安装
下载安装包,目前最稳定的是3.4.6版本
zookeeper-3.4.6.tar.gz
tar -xzvf  zookeeper-3.4.6.tar.gz
cd ./zookeeper-3.4.6
cp conf/zoo_sample.cfg conf/zoo.cfg
创建安装目录文件夹
mkdir /var/lib/zookeeper/
mkdir /var/lib/zookeeper/data

vi conf/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=/var/lib/zookeeper/data
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
server.1=10.160.29.5:2888:3888
server.2=10.160.29.10:2888:3888

保存后进入data
对应上面zoo.cfg中server.后的数字,第一台的内容为1,第二台的内容为2
vi myid
修改内容如下:
1

启动
./zkServer.sh start
[root@BZYWPT-server6 bin]# ./zkServer.sh start
JMX enabled by default
Using config: /usr/src/zookeeper-3.4.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
停止
./zkServer.sh stop

客户端测试
./zkCli.sh -server 10.160.29.5:2181

PS:防火墙端口要开放,否则无法访问。

 


 

阅读(2252) | 评论(0) | 转发(0) |
0

上一篇:Nginx初探之Lua

下一篇:Activity生命周期

给主人留下些什么吧!~~