zookeeper-3.4.5-cdh5.3.6集群安装

原创
2017/02/15 21:13
阅读数 1K

zookeeper-3.4.5-cdh5.3.6集群安装
1.在hadoop节点安装scala-2.10.4环境
       解压scala,设置环境变量
2.将scala和配置文件复制到其他节点
         scp /etc/profile hadoop1:/etc 
         scp /etc/profile hadoop2:/etc
         scp -r /usr/local/software/scala-2.10.4  hadoop1: /usr/local/software
         scp -r /usr/local/software/scala-2.10.4  hadoop2: /usr/local/software
3.解压zookeeper
  修改配置文件
  cp zookeeper/conf/zoo_sample.cfg zookeeper/conf/zoo.cfg
 vim zookeeper/conf/zoo.cfg
        dataDir=/usr/local/software/zookeeper-3.4.5-cdh5.3.6/zkdata
        dataLogDir=/usr/local/software/zookeeper-3.4.5-cdh5.3.6/zklog
        server.1=hadoop:2888:3888
        server.2=hadoop1:2888:3888
        server.3=hadoop2:2888:3888
        
        maxClientCnxns=0     #服务器最大连接数,默认是10,0表示不限制
        autopurge.snapRetainCount=3   #快照数
        autopurge.purgeInterval=1     #快照是否删除,0表示不删除,1表示删除
4.将zookeeper复制到其他节点
    scp -r /usr/local/software/zookeeper-3.4.5-cdh5.3.6 hadoop1:/usr/local/software/
    scp -r /usr/local/software/zookeeper-3.4.5-cdh5.3.6 hadoop2:/usr/local/software/
5.在各个节点按照zookeeper/conf/zoo.cfg在dataDir建立myid文件
在hadoop节点 tauch /usr/local/software/zookeeper-3.4.5-cdh5.3.6/zkdata/myid #里面写1
在hadoop1节点 tauch /usr/local/software/zookeeper-3.4.5-cdh5.3.6/zkdata/myid #里面写2
在hadoop2节点 tauch /usr/local/software/zookeeper-3.4.5-cdh5.3.6/zkdata/myid #里面写3            
6.在各个节点启动zookeeper
 zookeeper-3.4.5-cdh5.3.6/bin zkServer.sh start
7.查看zookeeper状态
 zookeeper-3.4.5-cdh5.3.6/bin zkServe.sh status
8.进入zookeeper客户端
 zookeeper-3.4.5-cdh5.3.6/bin zkCli.sh
 zookeeper-3.4.5-cdh5.3.6/bin zkCli.sh -server hadoop1:2181

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部