相關軟體安裝、設定:
hadoop 安裝配置: http://sc8log.blogspot.tw/2017/04/hadoop-cluster.html
hbase 安裝、設定: http://sc8log.blogspot.tw/2017/04/hbase-cluster.html
下載 zookeeper:
wget http://apache.stu.edu.tw/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz
hadoop 安裝配置: http://sc8log.blogspot.tw/2017/04/hadoop-cluster.html
hbase 安裝、設定: http://sc8log.blogspot.tw/2017/04/hbase-cluster.html
下載 zookeeper:
wget http://apache.stu.edu.tw/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz
tar -zxf zookeeper-3.4.9.tar.gz
sudo mv zookeeper-3.4.9 /usr/local/zookeeper
sudo chown hadoop:hadoop /usr/local/zookeeper
sudo mkdir -p /usr/local/zookeeper/logs
修改 /etc/bash.bashrc
export ZOOKEEPER_HOME=/usr/local/zookeeper
export PATH=$PATH:$ZOOKEEPER_HOME/bin
重新載入 bash.bashrc
source /etc/bash.bashrc
修改 zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/usr/local/zookeeper
clientPort=2181
dataLogDir=/usr/local/zookeeper/logs
server.1=master:2888:3888
server.2=slave01:2888:3888
server.3=slave02:2888:3888
server.4=slave03:2888:3888
重要:1、2、3、4 對應 myid 中的編號
設定主機 myid 編號
master:
sudo echo "1" > /usr/local/zookeeper/myid
slave01:
sudo echo "2" > /usr/local/zookeeper/myid
slave02:
sudo echo "3" > /usr/local/zookeeper/myid
slave03:
sudo echo "4" > /usr/local/zookeeper/myid
啟動
/usr/local/zookeeper/bin/zkServer.sh start
重新啟動 Zookeeper
/usr/local/zookeeper/bin/zkServer.sh restart
停止
/usr/local/zookeeper/bin/zkServer.sh stop
狀態
/usr/local/zookeeper/bin/zkServer.sh status
測試資料夾寫入 Zookeeper
進入 Zookeeper command 模式
/usr/local/hadoop/zookeeper/bin/zkCli.sh -server 127.0.0.1:2181
建立一個名為 mytest1 的資料夾進 File system
create /mytest test
查看 /mytest 資料夾檔案
ls /
沒有留言:
張貼留言