真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

hadoop中zookeeper環(huán)境的搭建方法

這篇文章主要講解了“hadoop中zookeeper環(huán)境的搭建方法”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“hadoop中zookeeper環(huán)境的搭建方法”吧!

我們提供的服務有:網(wǎng)站建設、成都網(wǎng)站設計、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認證、麗江ssl等。為千余家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務,是有科學管理、有技術的麗江網(wǎng)站制作公司

server0ip:192.168.88.155(hadoop01)

server1ip:192.168.88.164(hadoop02)

server2ip:192.168.88.165(hadoop03)

解壓到app目錄下

[root@hadoop02 Desktop]# tar -zxvf zookeeper-3.4.5.tar.gz -C app/

[root@hadoop02 Desktop]# cd app

[root@hadoop02 app]# cd zookeeper-3.4.5

[root@hadoop02 zookeeper-3.4.5]# cd conf

[root@hadoop02 conf]# mv zoo_sample.cfg zoo.cfg

vi zoo.cfg

dataDir=/root/Desktop/app/zookeeper-3.4.5/data

添加

server.1=hadoop01:2888:3888
server.2=hadoop02:2888:3888
server.3=hadoop03:2888:3888

[root@hadoop02 conf]# cd ..
[root@hadoop02 zookeeper-3.4.5]# mkdir data

[root@hadoop02 zookeeper-3.4.5]# cd data

[root@hadoop02 data]# echo 1 >myid
[root@hadoop02 data]# cat myid
1

[root@hadoop02 data]# cd ..
[root@hadoop02 zookeeper-3.4.5]# cd ..
[root@hadoop02 app]# ls
zookeeper-3.4.5

[root@hadoop02 app]# scp -r zookeeper-3.4.5/ hadoop02:/root/Desktop/app

進入hadoop02的主機

[root@localhost ~]# cd /root/Desktop/app

[root@localhost app]# cd zookeeper-3.4.5
[root@localhost zookeeper-3.4.5]# ls
bin          dist-maven       NOTICE.txt            zookeeper-3.4.5.jar.asc
build.xml    docs             README_packaging.txt  zookeeper-3.4.5.jar.md5
CHANGES.txt  ivysettings.xml  README.txt            zookeeper-3.4.5.jar.sha1
conf         ivy.xml          recipes
contrib      lib              src
data         LICENSE.txt      zookeeper-3.4.5.jar

[root@localhost zookeeper-3.4.5]# cd data
[root@localhost data]# ls
myid
[root@localhost data]# echo 2 >myid
[root@localhost data]# cat myid
2

進入hadoop03的server

[root@localhost app]# cd zookeeper-3.4.5
[root@localhost zookeeper-3.4.5]# ls
bin          docs                  README.txt
build.xml    ivysettings.xml       recipes
CHANGES.txt  ivy.xml               src
conf         lib                   zookeeper-3.4.5.jar
contrib      LICENSE.txt           zookeeper-3.4.5.jar.asc
data         NOTICE.txt            zookeeper-3.4.5.jar.md5
dist-maven   README_packaging.txt  zookeeper-3.4.5.jar.sha1

[root@localhost data]# ls
myid
[root@localhost data]# echo 3 >myid
[root@localhost data]# cat myid
3

啟動集群

[root@hadoop02 conf]# cd ..

[root@hadoop02 zookeeper-3.4.5]# cd bin

[root@hadoop02 bin]# ./zkServer.sh start
JMX enabled by default
Using config: /root/Desktop/app/zookeeper-3.4.5/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@hadoop02 bin]# jps
5386 NodeManager
20801 Jps
4912 DataNode
5288 ResourceManager
17430 QuorumPeerMain
5126 SecondaryNameNode

同理啟動hadoop02

[root@localhost zookeeper-3.4.5]# cd bin
[root@localhost bin]# ls
README.txt    zkCli.cmd  zkEnv.cmd  zkServer.cmd
zkCleanup.sh  zkCli.sh   zkEnv.sh   zkServer.sh
[root@localhost bin]# ./zkServer.sh start
JMX enabled by default
Using config: /root/Desktop/app/zookeeper-3.4.5/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@localhost bin]# jps
9635 QuorumPeerMain
5538 SecondaryNameNode
5722 ResourceManager
9649 Jps
5195 NameNode
5820 NodeManager
5322 DataNode

啟動hadoop03

root@localhost zookeeper-3.4.5]# cd bin
[root@localhost bin]# ls
README.txt    zkCli.cmd  zkEnv.cmd  zkServer.cmd
zkCleanup.sh  zkCli.sh   zkEnv.sh   zkServer.sh
[root@localhost bin]# ./zkServer.sh start
JMX enabled by default
Using config: /root/Desktop/app/zookeeper-3.4.5/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@localhost bin]# jps
9275 Jps
5520 SecondaryNameNode
5691 ResourceManager
5789 NodeManager
9251 QuorumPeerMain
5310 DataNode

hadoop01

[root@hadoop02 bin]# ./zkServer.sh status
JMX enabled by default
Using config: /root/Desktop/app/zookeeper-3.4.5/bin/../conf/zoo.cfg
Mode: follower
hadoop02

[root@localhost bin]# ./zkServer.sh status
JMX enabled by default
Using config: /root/Desktop/app/zookeeper-3.4.5/bin/../conf/zoo.cfg
Mode: leader

hadoop03

root@localhost bin]#  ./zkServer.sh status
JMX enabled by default
Using config: /root/Desktop/app/zookeeper-3.4.5/bin/../conf/zoo.cfg
Mode: follower
若出現(xiàn)Error contacting service. It is probably not running. error

一般是zookeeper-3.4.5 集群啟動不成功, 在確保每臺zookeeper-3.4.5啟動后若還是出現(xiàn)問題

[root@hadoop01 ~]# find / -name zookeeper.out
/root/Desktop/app/zookeeper-3.4.5/bin/zookeeper.out

找出日志的位置查看

 tail -50 /root/Desktop/app/zookeeper-3.4.5/bin/zookeeper.out

   連接客戶端

[root@hadoop02 bin]# sh zkCli.sh

[zk: localhost:2181(CONNECTED) 0] help幫助

[zk: localhost:2181(CONNECTED) 1] ls /
[zookeeper]
[zk: localhost:2181(CONNECTED) 2] create /hadoop 78
Created /hadoop

[zk: localhost:2181(CONNECTED) 4] get /hadoop
78

[zk: localhost:2181(CONNECTED) 7] set /hadoop xxxx

[zk: localhost:2181(CONNECTED) 5] create /hadoop/test mon:hadooop;tue:hdfs;
Created /hadoop/test
[zk: localhost:2181(CONNECTED) 6] get /hadoop/test
mon:hadooop;tue:hdfs;

連接hadoop03

[zk: localhost:2181(CONNECTED) 0] get /hadoop
78
kill -9  jps的線程

感謝各位的閱讀,以上就是“hadoop中zookeeper環(huán)境的搭建方法”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對hadoop中zookeeper環(huán)境的搭建方法這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關知識點的文章,歡迎關注!


網(wǎng)站題目:hadoop中zookeeper環(huán)境的搭建方法
鏈接分享:http://weahome.cn/article/gggieg.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部