Zookeeper集群搭建(简单)(29)

原创
2014/03/30 20:33
阅读数 61

1    搭建zookeeper的集群

1.1    zookeeper集群要求至少3个节点(hadoop0,hadoop1,hadoop2)(第27章hadoop集群搭建),且是奇数个,且节点之间的时间要同步。

1.2    在hadoop0上对zookeeper.tar.gz进行复制,解压缩、重命名、设置环境变量.

        (1)复制zookeeper-3.4.tar.gz到/usr/local目录,然后进入到该目录

        (2)执行命令tar -zxvf    zookeeper-3.4.tar.gz进行解压缩

        (3)重命名mv zookeeper-3.4     zookeeper

1.3    在hadoop0上进入zookeeper的conf目录

            mv    zoo_sample.cfg    zoo.cfg

1.4    在hadoop0上进入/usr/local/zookeeper/conf目录下,进行编辑文件zoo.cfg,

        修改dataDir=/tmp/zookeeper    改成data=/usr/local/zookeeper/data

        新增以下三行:

                    server.0=hadoop0:2888:3888

                    server.1=hadoop1:2888:3888

                    server.2=hadoop2:2888:3888

        在hadoop0上创建文件夹,执行命令mkdir    -p    /usr/local/zookeeper/data

1.5    在hadoop0的data目录下,创建文件myid,文件内容是0

1.6    把hadoop0上的zookeeper文件夹和/etc/profile复制到hadoop1,hadoop2节点.

1.7    在hadoop1上执行source /etc/profile,修改myid的值为1

         在hadoop2上执行source /etc/profile,修改myid的值为2

1.8    分别ssh到三个节点,在三个分别执行命令zkServer.sh    start

1.9    验证:在各个节点分别执行jps,发现多一个java进程是QuorumPeerMain. 

                                                                                                        

                                                                                                                Name:Xr

                                                                                                                Date:2014-3-30 20:31

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