Zookeeper集群搭建

  分类:技术   评论:3条  浏览: 49次

Zookeeper集群搭建

一、集群规划与环境配置

序号 IP 主机名 软件
1 192.168.14.64 / 172.16.1.30 zookeeper1 jdk、zookeeper
2 192.168.14.32 / 172.16.1.34 zookeeper2 jdk、zookeeper
3 192.168.14.49 / 172.16.1.10 zookeeper3 jdk、zookeeper
172.16.1.30 zookeeper1
172.16.1.34 zookeeper2
172.16.1.10 zookeeper3

二、安装Zookeeper集群

tar zxvf zookeeper_3_4_9.tar.gz
mkdir data
cd data
echo 1 > myid
echo 2 > myid
echo 3 > myid
dataDir=/opt/zookeeper-3.4.9/data

server.1=zookeeper1:2888:3888
server.2=zookeeper2:2888:3888
server.3=zookeeper3:2888:3888
export ZOOKEEPER_HOME=/opt/zookeeper-3.4.9
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export CLASSPATH=.:$ZOOKEEPER_HOME/lib/dt.jar:$ZOOKEEPER_HOME/lib/tools.jar
scp /etc/hosts zookeeper2:/etc/
scp /etc/hosts zookeeper3:/etc/

scp zoo.cfg zookeeper2:$ZOOKEEPER_HOME/conf/
scp zoo.cfg zookeeper3:$ZOOKEEPER_HOME/conf/
zkServer.sh start
  1. 高手不用看,新手看不懂

    回复
  2. 跟着教程搭建Zookeeper集群挺容易的。现在不知道怎么运用起来,望大佬出个最佳实践demo啊。

    回复
    1. @xiaohe

      可以加我qq,或者描述下问题

      回复
点击这里给我发消息
嘿!有什么可以帮助你吗?