zookeeper-3.5.1 for Hadoop 2.7安装
2015-09-16 10:29
387 查看
安装zookeeper-3.5.1之前是将hadoop已经安装完毕
操作系统版本:centos 6.5 x64
192.168.8.141 HD1
192.168.8.142 HD2
192.168.8.143 HD3
192.168.8.144 HD4
tar –xvf zookeeper-3.5.1-alpha.tar
移至/usr 目录下
Mv zookeeper-3.5.1-alpha /usr/ zookeeper
export ZOOKEEPER_HOME=/usr/zookeeper
exportPATH=$PATH:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$ZOOKEEPER_HOME/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
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/.
根据zoo.cfg的配置上server.*在1-4号机分别填入相对应的1-4
分别在1-4号机上执行 source /etc/profile
#zkServer.shstart
Using config:/usr/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
ZooKeeper JMX enabled by default
Using config:/usr/zookeeper/bin/../conf/zoo.cfg
Client port found: 2181. Client address:localhost.
Mode: follower
下载地址
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.gztar –xvf zookeeper-3.5.1-alpha.tar
移至/usr 目录下
Mv zookeeper-3.5.1-alpha /usr/ zookeeper
设置环境变量
Vi /etc/profileexport ZOOKEEPER_HOME=/usr/zookeeper
exportPATH=$PATH:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$ZOOKEEPER_HOME/conf
安装zookeeper
配置zookeeper的cfg文件
Cd /usr/zookeeper/confCp 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,HD4scp –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 statusZooKeeper JMX enabled by default
Using config:/usr/zookeeper/bin/../conf/zoo.cfg
Client port found: 2181. Client address:localhost.
Mode: follower
相关文章推荐
- 从源码安装Mysql/Percona 5.5
- 详解HDFS Short Circuit Local Reads
- Hadoop_2.1.0 MapReduce序列图
- 使用Hadoop搭建现代电信企业架构
- 在 AppImage、Flathub 和 Snapcraft 平台上搜索 Linux 应用
- 单机版搭建Hadoop环境图文教程详解
- 解决vc中unable to connect to the MKS:Internal error问题
- [游戏资讯]《极品飞车16:亡命狂飙》配置需求公布
- 杰奇一些安装详细说明文件,比官方更细
- 路由器备份配置
- 无线网卡安装DIY
- 网卡安装常见问题精解
- DB2数据库的安装
- CentOS下DB2数据库安装过程详解
- 路由器的基本配置
- 路由器基础配置及传输协议
- 经典配置 Vlan篇
- 备份线路的配置
- ghost安装系统软件硬盘安装器 安装ghost图文教程