Install zookeeper cluster under Linux

Source: Internet
Author: User
Tags zookeeper

First, prepare three Linux virtual machines

three machines centos01:192.168.1.168(lxs001) centos03:192.168.1.178( lxs003) centos03:192.168.1.188(lxs003) three machines

Download Zookeeper:

go to opt catalogue

Download Zookeeper:wget http://apache.fayea.com/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz

Decompression ZOOKEEPER:TAR-ZXVF zookeeper-3.4.6.tar.gz

zookeeper-3.4.6 renamed to Zookeeper:MV zookeeper-3.4.6 Zookeeper

Go to conf directory profile CP copy a zoo.cfg backup

Edit Zoo.cfg:Vim Zoo.cfg

instead

Increase cluster information

server.1=192.168.1.168:2888:3888

server.2=192.168.1.178:2888:3888

server.3=192.168.1.188:2888:3888

Copy the zoo.cfg configured on 168 to 178 1882 machines

SCP zoo.cfg [Email protected]:/opt/zookeeper/conf

configuration datadir: Just datadir for/var/zookeeper

Enter var, mkdir new zookerper folder

vim myID New myid text edit myID text and write the number after service ,

Also create a myID on 178 188, respectively, and write the 2,3

The above configuration is ready to connect the test zookeeper, CD into the/opt/zookeeper/bin directory, start

Telnet 192.168.1.168 2181

If the Telnet is not installed, install it first.

Enter stat after successful reconnection

Start 178 188 servers at the same time

Sometimes the cluster is not, it may be that the firewall is not shut down on the machine, shut down the firewall separately on three machines

And the last three machines are clustered down here.

Install zookeeper cluster under Linux

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.