您当前的位置: 首页 >  zookeeper

宝哥大数据

暂无认证

  • 3浏览

    0关注

    1029博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Zookeeper安装

宝哥大数据 发布时间:2017-02-05 17:51:16 ,浏览量:3

参考官方文档:http://zookeeper.apache.org/doc/r3.4.6/zookeeperStarted.html

zookeeper完全分布式的安装

1、下载zookeeper-3.4.6 2、解压到安装目录 3、编辑配置文件{ZOOKEEPER_HOME/conf/zoo.cfg} dataDir:指定内存数据库的路径 server.x中序号是为了区分zookeeper集群,当zookeeper集群启动, 会在myid文件找到对应的序号。

[chb@TEST conf]$ cat zoo.cfg 
tickTime=2000
dataDir=/usr/local/zookeeper-3.4.6/zookeeper
clientPort=2181
initLimit=5
syncLimit=2
server.1=TEST:2888:3888
server.2=TEST1:2888:3888
server.3=TEST2:2888:3888
[chb@TEST conf]$ 

tickTime   the basic time unit in milliseconds used by ZooKeeper. It is used to do heartbeats and the minimum session timeout will be twice 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 connection

4、创建myid文件, 对应server.x的序号

这里写图片描述

5、将zookeeper配置到环境变量中

添加如下:

#zookeeper
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.6
export PATH=$PATH:$ZOOKEEPER_HOME/bin

使/etc/profile有效:

source /etc/profile
6、启动zookeeper server
zkServer.sh start
7、会在当前目录下生成一个zookeeper.out的日志文件:

确保没有错误出现

8、查看zookeeper的内存数据库

这里写图片描述

9问题:zookeeper错误记录一;Cannot open channel to 2 at election address s1ave1/192.168.10.225:3888 java.net.Connection.

修改zookeeper配置如下:

端口
server.1=192.168.10.224:2878:3878
server.2=192.168.10.225:2898:3898
server.3=192.168.10.226:2889:3889
clientPort=3384
关注
打赏
1587549273
查看更多评论
立即登录/注册

微信扫码登录

0.0439s