安装Zookeeper
cd /opt/bigdata
tar -zvxf zookeeper-3.4.10.tar.gz
vi /etc/profile
添加:
#zookeeper
export ZOOKEEPER_HOME=/opt/bigdata/zookeeper-3.4.10
export PATH=$PATH:$ZOOKEEPER_HOME/bin
source /etc/profile
cd /opt/bigdata/zookeeper-3.4.10
mkdir data
mkdir log
cd conf
cp zoo_sample.cfg zoo.cfg
vi zoo.cfg
修改
#配置数据存放目录
dataDir=/opt/bigdata/zookeeper-3.4.10/data
#配置日志存放目录
dataLogDir=/opt/bigdata/zookeeper-3.4.10/log
末尾添加
#配置集群地址
server.1=cluster201:2888:3888
server.2=cluster202:2888:3888
server.3=cluster203:2888:3888
cd ..
cluster201节点执行
echo 1 > data/myid
cluster202节点执行
echo 2 > data/myid
cluster203节点执行
echo 3 > data/myid
zkServer.sh start
zkServer.sh status