Linux/centos Zookeeper cluster installation

Source: Internet
Author: User
Tags zookeeper

Zookeeper cluster installation
The package included in the article plus the bottom of the free access

Software version 3.4.8

Upload zookeeper-3.4.8.tar.gz to App server directory:/USR/LOCAL/SRC (package see attachment)

168.0.1 for App server ip192.168.0.2 to DB server IP
#cd/USR/LOCAL/SRC
#tar-ZXVF zookeeper-3.4.8.tar.gz
#mv zookeeper-3.4.8 Zookeeper
#vim/etc/profile//Add the following to the end of the file and save
#ZOOKEEPER
Zookeeper=/usr/local/src/zookeeper
Path= $PATH: $ZOOKEEPER/bin
#source/etc/profile
#cp/usr/local/src/zookeeper/conf/zoo_sample.cfg/usr/local/src/zookeeper/conf/zoo.cfg
#mkdir/DATA/ZOOKEEPER-PV
#vim/usr/local/src/zookeeper/conf/zoo.cfg//Modify the contents of the file as follows
ticktime=2000
initlimit=10
Synclimit=5
Datadir=/data/zookeeper
clientport=2181
minsessiontimeout=1000
maxsessiontimeout=10000
server.1=192.168.0.1:2888:3888
server.2=192.168.0.2:2888:3888
Server. A=b:c:d: Where A is a number, indicating this is the first server, B is the IP address of this server, C is the server and the Leader server in the cluster to exchange information on the port; D means that in case the Leader server in the cluster hangs, a port is needed to re-elect , select a new Leader, which is the port that the server communicates with each other when the election is performed. If it is a pseudo-cluster configuration, because B is the same, so different Zookeeper instance communication port numbers can not be the same, so they should be assigned a different port number.
Perform the above installation steps on both the app server and the DB server

Then do the following

192.168.0.1 this machine.
#echo "1" >/data/zookeeper/myid
192.168.168.0.2 this machine.
#echo "2" >/data/zookeeper/myid
Start two zookeeper
#/usr/local/zookeeper/bin/zkserver start
#zkServer. SH Status//query zookeeper State
#zkCli. Sh-server 192.168.0.1 (192.168.0.2): 2181//The connection to the service cluster can be established on either node

If you are interested in this, please scan the QR code below for free for more details

Linux/centos Zookeeper cluster installation

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.