Zookeeper3.4.6擬似分布クラスタの配備(Apache)


1、Zookeeperをダウンロードする
    http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.6/
2、/usr/app/zookeeperディレクトリを作成し、以下のようにそのディレクトリに切り替える
     clip_image001
3、rzコマンドを使用してzookeeper-3.4をアップロードする.6.tar.gz
    
4、解凍(tar zxvf zookeeper-3.4.6.tar.gz)、以下の通り
    
     clip_image004
5、zookeeper-3.4を削除する.6.tar.gz、以下に示す
    
6、名称zookeeper-3.4.6はzookeeper 1で、以下のようになります.
    
7、zookeeper 1ディレクトリの下で、data、datalogの2ディレクトリを作成し、以下のようにする.
     Zookeeper3.4.6部署伪分布集群(Apache)_第1张图片
8、dataディレクトリの下にmyidファイルを作成し、数字1を入力し、現在のホストを識別するために終了を保存する
     Zookeeper3.4.6部署伪分布集群(Apache)_第2张图片
9、confディレクトリの下でzoo_sample.cfgの名前はzoo.cfg、zooを編集します.cfgファイル、以下に示す
     Zookeeper3.4.6部署伪分布集群(Apache)_第3张图片
  zoo.cfgファイルの内容は以下の通りです.
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
# zookeeper        server,      leader,        follower,initLimit        ,
# follower leader         .         10,        10 tickTime,  10*2000=20000ms=20s
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
#      leader follower      ,             .         5,        5 tickTime,  10000ms
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/usr/app/zookeeper/zookeeper1/data
dataLogDir=/usr/app/zookeeper/zookeeper1/datalog
# the port at which the clients will connect
#       ,  server clientPort    
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.X=A:B:C
#         X     ,        server
#       A  server   IP  
#       B   server     leader          
#       C    leader       
#         :      ,   server B, C      
server.1=ljc:2888:3888
server.2=ljc:2889:3889 
server.3=ljc:2890:3890

10、/usr/app/zookeeper/に切り替え、zookeeper 1を2部のzookeeper 2、zookeeper 3をコピーし、以下のようにする
     clip_image011
     Zookeeper3.4.6部署伪分布集群(Apache)_第4张图片
11、zookeeper 2の2つのファイル(data/myid、conf/zoo.cfg)を修正し、myidファイルの内容を2に修正し、zooを修正する.cfgファイルのプロパティ(dataDir=/usr/app/zookeeper/zookeeper 2/data、dataLogDir=/usr/app/zookeeper/zookeeper 2/datalog、clientPort=2182)
12、zookeeper 3の2つのファイル(data/myid、conf/zoo.cfg)を修正し、myidファイルの内容を3に変更し、zooを修正する.cfgファイルのプロパティ(dataDir=/usr/app/zookeeper/zookeeper 3/data、dataLogDir=/usr/app/zookeeper/zookeeper 3/datalog、clientPort=2183)
13、zookeeperを起動する
     Zookeeper3.4.6部署伪分布集群(Apache)_第5张图片
次の結果が表示された場合は、起動に成功しました.
     Zookeeper3.4.6部署伪分布集群(Apache)_第6张图片
 
もし、このブログを読むと少し収穫があると思ったら、「頂」してみてください.もし、私の新しいブログをもっと簡単に発見したいなら、「購読」してもいいです.もし、私のブログの内容に興味があれば、私の後続のブログに引き続き注目してください.私は「劉超-ljc」です.
本文の著作権は著者とcsdnの共有に帰属し、転載を歓迎するが、著者の同意を得ずにこの声明を保留し、文章のページの明らかな位置で原文の接続を与えなければならない.そうしないと、法律責任を追及する権利を保留する.