zookeeper-3.5.1 for Hadoop 2.7安装


安装zookeeper-3.5.1之前是将hadoop已经安装完毕

 

下载地址

http://mirror.bit.edu.cn/apache/zookeeper/

 

集群节点环境

hadoop版本:2.7.1
操作系统版本:centos 6.5 x64

192.168.8.141 HD1

192.168.8.142 HD2

192.168.8.143 HD3

192.168.8.144 HD4

 

安装准备

上传至HD1 解压

gunzip zookeeper-3.5.1-alpha.tar.gz

tar –xvf zookeeper-3.5.1-alpha.tar

移至/usr 目录下

Mv zookeeper-3.5.1-alpha /usr/ zookeeper

 

设置环境变量

Vi /etc/profile

export ZOOKEEPER_HOME=/usr/zookeeper

exportPATH=$PATH:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$ZOOKEEPER_HOME/conf

 安装zookeeper

配置zookeeper的cfg文件

Cd /usr/zookeeper/conf

Cp zoo_sample.cfg zoo.cfg

配置如下

[root@HD1 conf]# more 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 anacknowledgement

syncLimit=5

# the directory where the snapshot isstored.

# do not use /tmp for storage, /tmp here isjust

# example sakes.

dataDir=/usr/zookeeper/data

dataLogDir/usr/zookeeper/logs

# the port at which the clients willconnect

clientPort=2181

# the maximum number of client connections.

# increase this if you need to handle moreclients

#maxClientCnxns=60

#

# Be sure to read the maintenance sectionof the

# administrator guide before turning onautopurge.

#

#http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance

#

# The number of snapshots to retain indataDir

#autopurge.snapRetainCount=3

# Purge task interval in hours

# Set to "0" to disable autopurge feature

#autopurge.purgeInterval=1

server.1=HD1:2888:3888

server.2=HD2:2888:3888

server.3=HD3:2888:3888

server.4=HD4:2888:3888

 

建立/usr/zookeeper/data这个目录

Mkdir –p /usr/zookeeper/data

 

建立myid

Touch /usr/zookeeper/data/myid

同步配置

复制同步配置至HD2,HD3,HD4

 

scp –r /usr/zookeeper HD2:/usr/.

scp –r /usr/zookeeper HD3:/usr/.

scp –r /usr/zookeeper HD4:/usr/.

 

Scp –r /etc/profile HD2:/etc/.

Scp –r /etc/profile HD3:/etc/.

Scp –r /etc/profile HD4:/etc/.

 

编辑myid

Vi /usr/zookeeper/data/myid

根据zoo.cfg的配置上server.*在1-4号机分别填入相对应的1-4


分别在1-4号机上执行 source /etc/profile

 

启动zookeeper

分别在1-4号机上启动zookeeper

#zkServer.shstart

Using config:/usr/zookeeper/bin/../conf/zoo.cfg

Starting zookeeper ... STARTED

 

验证zookeeper是否启动成功

[root@HD2 ~]# zkServer.sh  status

ZooKeeper JMX enabled by default

Using config:/usr/zookeeper/bin/../conf/zoo.cfg

Client port found: 2181. Client address:localhost.

Mode: follower

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值