Deploy zookeeper pseudo cluster on Linux __linux

Source: Internet
Author: User
Tags zookeeper

1. Download zookeeper-3.4.6.tar.gz

2. Decompression Compression Package TAR-ZXVF zookeeper-3.4.6.tar.gz

3. Rename folder zookeeper-3.4.6 to Zookeeper1

4. The same steps performed 2 times

5.CD zookeeper1/conf/

6.VI zoo.cfg

7. Modify the directory where the zookeeper saves data--------Datadir=/opt/zookeeper/zookeeper1/data.

8. The client connects to the zookeeper server's port, zookeeper listens to the port, accepts the client's access request------clientport=2185.

9. Add Server. X=A:B:C where x is a number, which means this is the first date server. A is the IP address of the server. b Configure the ports used by the leader Exchange messages in this server and in the cluster. C Configure the port to use when electing leader. Because the configuration is pseudo cluster mode, the B, c parameters of each server must be different.

server.1=127.0.0.1:2887:3887
server.2=127.0.0.1:2888:3888
server.3=127.0.0.1:2889:3889


10. Enter the data directory, touch myID file, vi myID, write 1.

11. Repeat operation two times, pay attention to modify Datadir=/opt/zookeeper/zookeeper2/data, Datadir=/opt/zookeeper/zookeeper3/data; clientPort=2186, Clientport=2187;myid Write to 2,myid write 3.

12 Enter the bin directory under Zookeeper1 respectively.

13 start Zookeeper1./zkserver.sh Start (note: The bin directory under the log file Zookeeper.out, can not afford to see the cause of the error here).

14 Start Zookeeper2,zookeeper3 separately.

15 See if the startup is successful (all zookeeper in the cluster are started to view)./zkserver.sh status.


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.