Manual configuration of Zookeeper in Ubuntu environment

Source: Internet
Author: User
Tags zookeeper

Configure Zookeeper

Note: Because it is a single-machine pseudo-distributed configuration, there are 3 servers on the same

The zookeeper file format is as follows

Home---Zookeeper---server0---zookeeper                    |                    ------------Server1---zookeeper                    |                    ------------Server2---Zookeeper

1. Download Zookeeper(I'm using: zookeeper-3.4.6.tar.gz)

Unzip separately to/home/zookeeper/server0

/home/zookeeper/server1

/home/zookeeper/server2

2. Folder settings

Generate logs and data folders under Zookeeper in 3 servers, respectively

sudo mkdir datasudo mkdir logs//must be in the Zookeeper folder of each server

Generate myID files under Zookeeper/data in 3 servers, respectively, and write 0,1,2 in open files (Server0 write 0,server1 write in 1,server2 2)

sudo gedit myid//generates myID files and must be in the Data folder

3. Configure Zoo.cfg(Configure the time, note the datadir of the following address do not bring unnecessary strings!!!) Like a space or something. )

In the Zookeeper/conf folder, Sir, into this empty file.

sudo gedit zoo.cfg//must be under the Conf folder

Server0 in zoo.cfg fill in the content

ticktime=2000initlimit=5synclimit=2datadir=/home/zookeeper/server0/zookeeper/datadatalogdir=/home/zookeeper/ Server0/zookeeper/logsclientport=2182server.0=127.0.0.1:8880:7770server.1=127.0.0.1:8881:7771server.2= 127.0.0.1:8882:7772

Server1 in zoo.cfg fill in the content

ticktime=2000initlimit=5synclimit=2datadir=/home/zookeeper/server1/zookeeper/datadatalogdir=/home/zookeeper/ Server1/zookeeper/logsclientport=2182server.0=127.0.0.1:8880:7770server.1=127.0.0.1:8881:7771server.2= 127.0.0.1:8882:7772

Server2 in zoo.cfg fill in the content

ticktime=2000initlimit=5synclimit=2datadir=/home/zookeeper/server2/zookeeper/datadatalogdir=/home/zookeeper/ Server2/zookeeper/logsclientport=2182server.0=127.0.0.1:8880:7770server.1=127.0.0.1:8881:7771server.2= 127.0.0.1:8882:7772

4. Start all clusters of servers

Enter the/bin folder for each of the three servers:

sudo./zkserver.sh start  

5. Access the client

Enter any of the server's/bin folders:

sudo./zkcli.sh–server 127.0.0.1:2181  

6. End

You can use Help to inquire about commands

Manual configuration of Zookeeper in Ubuntu environment

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.