1. 程式人生 > >zookeeper偽分散式叢集搭建(centOS7)

zookeeper偽分散式叢集搭建(centOS7)

zookeeper版本:zookeeper-3.4.10.tar.gz
下載好zookeeper之後,放到/usr/local目錄下
1.建立zookeeper目錄,並在zookeeper目錄下,建立三個資料夾,分別為server1,server2,server3

cd /usr/local
mkdir zookeeper
cd zookeeper
mkdir server1
mkdir server2
mkdir server3

2.將zookeeper壓縮包分別解壓到三個資料夾中

tar -zxvf /usr/local/zookeeper-3.4.10.tar.gz -C /usr/local
/zookeeper/server1 tar -zxvf /usr/local/zookeeper-3.4.10.tar.gz -C /usr/local/zookeeper/server2 tar -zxvf /usr/local/zookeeper-3.4.10.tar.gz -C /usr/local/zookeeper/server3

3.在解壓的資料夾中分別建立data資料夾和logs資料夾

mkdir server1/zookeeper-3.4.10/data
mkdir server1/zookeeper-3.4.10/logs
mkdir server2/zookeeper-3.4.10/data
mkdir server2/zookeeper-3.4
.10/logs mkdir server3/zookeeper-3.4.10/data mkdir server3/zookeeper-3.4.10/logs

4.在三個data資料夾中分別建立myid檔案,裡面的值從server1到server3分別為1,2,3

5.進入conf資料夾,生成zoo.cfg,並修改其內容

cd /usr/local/zookeeper/server1/zookeeper-3.4.10/conf
mv zoo_sample.cfg zoo.cfg
vi zoo.cfg

server1的zoo.cfg修改如下:

# The number of milliseconds of each tick
tickTime=2000 # The number of ticks that the initial # synchronization phase can take initLimit=10 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit=5 # the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just # example sakes. dataDir=/usr/local/zookeeper/server1/zookeeper-3.4.10/data dataLogDir=/usr/local/zookeeper/server1/zookeeper-3.4.10/logs # the port at which the clients will connect clientPort=2181 # the maximum number of client connections. # increase this if you need to handle more clients #maxClientCnxns=60 # # Be sure to read the maintenance section of the # administrator guide before turning on autopurge. # # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance # # The number of snapshots to retain in dataDir #autopurge.snapRetainCount=3 # Purge task interval in hours # Set to "0" to disable auto purge feature #autopurge.purgeInterval=1 server.1=127.0.0.1:8881:7771 server.2=127.0.0.1:8882:7772 server.3=127.0.0.1:8883:7773

server2的zoo.cfg修改如下:

[[email protected] conf]# vi zoo.cfg 
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/usr/local/zookeeper/server2/zookeeper-3.4.10/data
dataLogDir=/usr/local/zookeeper/server2/zookeeper-3.4.10/logs
# the port at which the clients will connect
clientPort=2182
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=127.0.0.1:8881:7771
server.2=127.0.0.1:8882:7772
server.3=127.0.0.1:8883:7773

server3的zoo.cfg修改如下:

[[email protected] conf]# vi zoo.cfg 
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/usr/local/zookeeper/server3/zookeeper-3.4.10/data
dataLogDir=/usr/local/zookeeper/server3/zookeeper-3.4.10/logs
# the port at which the clients will connect
clientPort=2183
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=127.0.0.1:8881:7771
server.2=127.0.0.1:8882:7772
server.3=127.0.0.1:8883:7773

修改了dataDir,dataLogDir,clientPort的值,由於這是偽分散式叢集,所以clientPort一定不能相同。後面追加了server.?,這個?對應了myid裡面的值。

6.分別啟動三個zookeeper

cd /usr/local/zookeeper/server1/zookeeper-3.4.10/bin
./zkServer.sh start

cd /usr/local/zookeeper/server2/zookeeper-3.4.10/bin
./zkServer.sh start

cd /usr/local/zookeeper/server3/zookeeper-3.4.10/bin
./zkServer.sh start

7.檢視叢集狀態

分別進入三個server的bin目錄中使用./zkServer.sh status命令檢視狀態

三個的狀態分別為

ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/server1/zookeeper-3.4.10/bin/../conf/zoo.cfg
Mode: follower

ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/server2/zookeeper-3.4.10/bin/../conf/zoo.cfg
Mode: leader

ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/server3/zookeeper-3.4.10/bin/../conf/zoo.cfg
Mode: follower

相關推薦

zookeeper分散式叢集搭建centOS7

zookeeper版本:zookeeper-3.4.10.tar.gz 下載好zookeeper之後,放到/usr/local目錄下 1.建立zookeeper目錄,並在zookeeper目錄下,建立三個資料夾,分別為server1,server2,serv

Hadoop單機/分散式叢集搭建新手向

此文已由作者朱笑笑授權網易雲社群釋出。 歡迎訪問網易雲社群,瞭解更多網易技術產品運營經驗。 本文主要參照官網的安裝步驟實現了Hadoop偽分散式叢集的搭建,希望能夠為初識Hadoop的小夥伴帶來借鑑意義。 環境: (1)系統環境:CentOS 7.3.1611 64位 (2)J

Hadoop單機、分散式叢集搭建十分詳細

原文地址:http://blog.csdn.net/dr_guo/article/details/50886667 下面我就一邊搭建一邊寫怎麼搭建Hadoop偽分佈模式。 1.下載jdk並安裝 去官網下就可以了,下完之後把檔案移到/o

Redis的分散式叢集搭建windows----RedisCluster叢集

今天研究了一下redis的叢集搭建,終於成功了,拿來給大家分享一下,希望對大家有幫助。如果需要原始碼和安裝包可以私我。 下載redis.進入redis資料夾呢 如果沒有redis.conf檔案,就新建一個 ,並在裡面寫上配置引數:                     

大資料分散式叢集搭建9

Sqoop相比於其他的工具搭建起來很容易 需要用到下面的東西 sqoop-1.4.6.tar.gz sqoop-1.4.6.jar mysql-connector-java-5.1.21.jar

大資料之Hadoop學習環境配置——Hadoop分散式叢集搭建

title: Hadoop偽分散式叢集搭建 date: 2018-11-14 15:17:20 tags: Hadoop categories: 大資料 點選檢視我的部落格: Josonlee’s Blog 文章目錄 前言準備 偽分

HBase分散式叢集搭建Hbase內建zookeeper 粗略筆記

hbase和hadoop一樣也分為單機版、偽分散式版和完全分散式叢集版本。 這裡記錄分散式叢集搭建(注:沒有安裝獨立的zookeeper,使用了hbase自帶的zookeeper。)

《Hadoop》之"踽踽獨行"Hadoop的分散式叢集搭建

在上一章我給大家介紹了Hadoop的單節點叢集本地模式的搭建,在這一章中,我們來了解一下Hadoop偽分散式叢集的搭建與用途。 一、Hadoop偽分散式叢集(pseudo distributed cluster) 1、簡介 hadoop的pseudo distributed&n

搭建真正的zookeeper叢集 搭建zookeeper分散式叢集

  搭建zookeeper偽分散式叢集 zookeeper是Hadop Ecosystem中非常重要的元件,它的主要功能是為分散式系統提供一致性協調服務, 提供的功能包括配置維護,域名服務,分散式同步和組服務。 zookeeper的目標就是封裝好複雜易出錯的關鍵服務,將簡單易用的介面和效能高

zookeeper叢集搭建備忘錄

安裝步驟: 提示:要關閉虛擬機器的防火牆,執行:service iptables stop 1.準備虛擬機器,安裝並配置jdk 我用的是1.8 2.上傳zookeeper的安裝包 3.4.7版本 3.解壓安裝 tar -xvf  ………… 4.配置zookeeper。

分散式搭建YARN上執行MapReduce 程式

偽分散式的搭建(YARN上執行MapReduce 程式) 1.啟動叢集 1.1在當前目錄下 1.2確保NameNode和DataNode已經啟動 1.3啟動ResourceManager 1.4啟動NodeManager

分散式搭建啟動HDFS並執行MapReduce程式

如果前一章測試成功,那麼恭喜你,你已經可以開始新的篇章了(但是如果測試不成功,請務必搭建測試成功後再看此篇章) 偽分散式的搭建(啟動HDFS並執行MapReduce程式) 1、啟動HDFS並執行MapReduce程式 1.1配置偽分散式叢集

centos7下Hadoop2.8.4全分佈搭建之HDFS叢集搭建

1)搭建前的準備 注意:(以下操作可以先配置一臺,然後通過scp命令傳送到其他兩臺虛擬機器上 傳送到其他機器 scp -r 主機名: 注意:載入環境變數 source /etc/profile

ZooKeeper叢集搭建:準備工作以及搭建叢集的具體操作

為什麼要做ZooKeeper叢集? ZooKeeper在Dubbo框架中起著發現服務,服務登出/註冊(動態伸縮)的功能,假如僅有的一臺Zookeeper宕機了,將會造成整個應用的服務呼叫失敗,服務停擺期間所造成的損失不可想象 同時Zookeeper也是很

Zookeeper分散式叢集環境搭建過程

前言 ZooKeeper是一個分散式的,開放原始碼的分散式應用程式協調服務,目前很多架構都基於它來實現配置維護、域名服務、分散式同步、組服務等等。 ZooKeeper的基本運轉流程: 1.選舉Leader 2.同步資料 3.選舉Leader過程中演算法

搭建zookeeper分散式叢集

偽分散式叢集的意思就是在同一臺機子上部署多個zookeeoer,但是他們的埠不一樣。 1.安裝zookeeper 到/usr/local 2.cd /usr/local/zookeeper 3.cd conf 4.vim zoo.cfg 在最下面新增如下內容 server.1=192.168.

Centos7.5下HDP叢集搭建

硬體環境:6臺伺服器,IP為172.16.172.17/18/19/20/21/22 軟體環境:作業系統為Centos7.5                  Ambari版本為2.5.0.3                  HDP版本為2.6.0.3 一、安裝前準

Hadoop2.2.0分散式環境搭建附:64位下編譯Hadoop-2.2.0過程

Hadoop2.2.0偽分散式環境搭建: 寫在前面:Hadoop2.2.0預設是支援32位的OS,如果想要在64位OS下執行的話,可以通過在64位OS下面編譯Hadoop2.2.0來實現,編譯的操作步驟在最後面呈現。 1: 操作:下載軟體; 檔案:Hadoop-2.2.0.

nginx搭建centos7

with cat 需要 style HR module AR top 表示 1、安裝前準備: 系統: CentOS 7.5 x64 下載包:wget yum -y install wget 安裝: 2、安裝一下這些依賴條件: yum

hadoop叢集搭建docker

背景     目前在一家快遞公司工作,因專案需要,對大資料平臺做個深入的瞭解。工欲利其器必先利其器,在網上找了許多教程,然後自己搭建一個本地的環境並記錄下來,增加一些印象。 環境搭建 1)Ubuntu   docker pull ubuntu:16.04 docker images&nb