本篇內(nèi)容介紹了“zookeeper-3.4.6集群的搭建步驟”的有關(guān)知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細閱讀,能夠?qū)W有所成!
在前鋒等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強發(fā)展的系統(tǒng)性、市場前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都做網(wǎng)站、網(wǎng)站制作 網(wǎng)站設(shè)計制作定制網(wǎng)站建設(shè),公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站制作,全網(wǎng)整合營銷推廣,外貿(mào)網(wǎng)站制作,前鋒網(wǎng)站建設(shè)費用合理。
我們采用zookeeper-3.4.6來搭建zookeeper集群,硬件為三臺DELL服務(wù)器(已經(jīng)關(guān)閉防火墻并且配置好ssh互信):
192.168.4.33 bi3
192.168.4.34 bi4
192.168.4.35 bi5
1. 解壓zookeeper-3.4.6安裝包到/home/hadoop/work目錄下:/home/hadoop/work/zookeeper-3.4.6
2. 配置conf/zoo.cfg
# the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just # example sakes. dataDir=/home/hadoop/work/zookeeper-3.4.6/var/data dataLogDir=/home/hadoop/work/zookeeper-3.4.6/var/datalog # the port at which the clients will connect clientPort=2181 server.1=bi3:2888:3888 server.2=bi4:2888:3888 server.3=bi5:2888:3888
3. 新建目錄
mkdir /home/hadoop/work/zookeeper-3.4.6/var/data mkdir /home/hadoop/work/zookeeper-3.4.6/var/datalog
4. 編輯/home/hadoop/work/zookeeper-3.4.6/var/data/myid,三臺機器的內(nèi)容分別如下:
192.168.4.33 bi3 | 1 |
192.168.4.34 bi4 | 2 |
192.168.4.35 bi5 | 3 |
啟動zookeeper集群,分別在三臺機器上執(zhí)行下面的命令
/home/hadoop/work/zookeeper-3.4.6/bin/zkServer.sh start
驗證集群是否可用
[hadoop@bi5 apps]$ /home/hadoop/work/zookeeper-3.4.6/bin/zkCli.sh -server 127.0.0.1:2181
進入zookeeper的client命令行模式,在根目錄下創(chuàng)建/zktest,然后查看是否創(chuàng)建成功
[zk: 127.0.0.1:2181(CONNECTED) 4] create /zktest test Created /zktest [zk: 127.0.0.1:2181(CONNECTED) 5] ls / [consumers, zktest, rmstore, mytest, spark, yarn-leader-election, spark-test, controller_epoch, dubbo, hbase, hadoop-ha, zookeeper, admin, config, brokers] [zk: 127.0.0.1:2181(CONNECTED) 6] get /zktest test cZxid = 0xf0006967b ctime = Mon Feb 15 17:19:32 CST 2016 mZxid = 0xf0006967b mtime = Mon Feb 15 17:19:32 CST 2016 pZxid = 0xf0006967b cversion = 0 dataVersion = 0 aclVersion = 0 ephemeralOwner = 0x0 dataLength = 4 numChildren = 0
“zookeeper-3.4.6集群的搭建步驟”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實用文章!