部署zookeeper集群
阿新 • • 發佈:2018-09-25
cfg logs 三臺 ecb type db4 onf mage bin ①下載包
cd /root/software
wget http://s***.hc-yun.com:10081/down/zookeeper-3.4.12.tar.gz
②解壓到指定文件夾
tar zxvf zookeeper-3.4.12.tar.gz -C /home/hadoop/
③修改zookeeper配置文件
cat <<EOF > /home/hadoop/zookeeper-3.4.12/conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/home/hadoop/zookeeper-3.4.12/data
clientPort=2181
server.1=master:2888:3888
server.2=slave01:2888:3888
server.3=slave02:2888:3888
EOF
④創建zookeeper的目錄
mkdir -p /home/hadoop/zookeeper-3.4.12/{data,logs,tmp}
⑤拷貝zookeeper到兩臺slave服務器上
scp -r /home/hadoop/ zookeeper-3.4.12 root@slave01:/home/hadoop
scp -r /home/hadoop/ zookeeper-3.4.12 root@slave01:/home/hadoop
⑥創建myid文件 【三臺服務器對應1、2、3】
echo 1 > /home/hadoop/zookeeper-3.4.12/data/myid
⑦啟動集群服務
sh /home/hadoop/zookeeper-3.4.12/bin/zkServer.sh start
sh /home/hadoop/zookeeper-3.4.12/bin/zkServer.sh status
cd /root/software
wget http://s***.hc-yun.com:10081/down/zookeeper-3.4.12.tar.gz
②解壓到指定文件夾
tar zxvf zookeeper-3.4.12.tar.gz -C /home/hadoop/
③修改zookeeper配置文件
cat <<EOF > /home/hadoop/zookeeper-3.4.12/conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/home/hadoop/zookeeper-3.4.12/data
clientPort=2181
server.1=master:2888:3888
server.3=slave02:2888:3888
EOF
④創建zookeeper的目錄
mkdir -p /home/hadoop/zookeeper-3.4.12/{data,logs,tmp}
⑤拷貝zookeeper到兩臺slave服務器上
scp -r /home/hadoop/ zookeeper-3.4.12 root@slave01:/home/hadoop
scp -r /home/hadoop/ zookeeper-3.4.12 root@slave01:/home/hadoop
⑥創建myid文件 【三臺服務器對應1、2、3】
echo 1 > /home/hadoop/zookeeper-3.4.12/data/myid
⑦啟動集群服務
sh /home/hadoop/zookeeper-3.4.12/bin/zkServer.sh start
sh /home/hadoop/zookeeper-3.4.12/bin/zkServer.sh status
部署zookeeper集群