Installing zookeeper under CentOS

Source: Internet
Author: User

Install zookeeper cluster steps under Linux

(1) Download Zookeeper installation package

Address: http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz

(2) Unzip the installation package and place it under the corresponding path

Unzip the corresponding file to the corresponding path, this article will extract the zookeeper to the/SOFT/ZK path, and in the ZK path to establish DataDir and Datalogdir path

Cd/soft/zk

TAR-XVF zookeeper-xxx.tar.gz

mkdir DataDir

mkdir Datalogdir

(3) Configuring the Zookeeper configuration file

Configuring the Zookeeper

Cd/soft/zk/zookeeper-xxx/conf

CP Zoo-sample.cfg Zoo.cfg

Vim Zoo.cfg

  

# The number of milliseconds of each tick
Ticktime= -# The number of ticks that the initial# synchronization phase can takeinitlimit=Ten# The number of ticks that can pass between# sending a request and getting an acknowledgementsynclimit=5# The directory where the snapshot is stored.# DoNot use/tmp forStorage,/tmp Here is just# example Sakes.datadir=/soft/zk/Datadirdatalogdir=/soft/zk/datalogdir# the Port atwhichThe clients would connectclientport=2181server.1=192.168.1.111:2888:3888server.2=192.168.1.112:2888:3888server.3=192.168.1.113:2888:3888

The zookeeper server is configured here, and it is necessary to match the myID with the corresponding server number

(4) Set the zookeeper corresponding myID file

Cd/soft/zk/datadir

Vim myID

Put the server number in

(5) Start zookeeper service

Cd/soft/zk/zookeeper-xxx/bin

SH zkserver.sh start

Start the service, pay attention to see zookeeper.out This log output, you can see the problem point

(6) Verify that the zookeeper is starting normally

Cd/soft/zk/zookeeper-xxx/bin

SH zkserver.sh status

SH zkcli.sh-server 192.168.1.111:2181

(7) Query the zookeeper server corresponding to the master-slave relationship status

Cd/soft/zk/zookeeper-xxx/bin

SH zkserver.sh status

Installing zookeeper under CentOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.