Zookeeper Cluster construction

Source: Internet
Author: User

Three machines, IP respectively 192.168.1.231, 192.168.1.232, 192.168.1.233

Tools used: SECURECRT, WinSCP
SECURECRT for connecting machines, executing commands
WinSCP for uploading files to machines

Premise: The machine installs the SSH service.

Download zookeeper-3.3.5.tar.gz, upload to the 231 machine using WINSCP, assuming the path is/home/grid/soft/
Use SECURECRT, execute command tar-zxvf zookeeper-3.3.5.tar.gz, unzip file
MV zookeeper-3.3.5 Zookeeper

Establish a soft connection (shortcut), Ln-s Zookeeper-3.3.5/zookeeper, this step is not necessary, just to facilitate later operation, and replace the zookeeper version does not need to modify the directory

CD zookeeper/conf

Modify file name
MV Zoo_sample.cfg Zoo.cfg

VI zoo.cfg
Modify the DataDir path, because the default temp path, after the system restarts, the data is emptied
Modified: Datadir=/home/grid/soft/zookeeper/datadir

After the file, add the following configuration:
server.1=192.168.1.231:2888:3888
server.2=192.168.1.232:2888:3888
server.3=192.168.1.233:2888:3888

Create DataDir:
CD Zookeeper
mkdir DataDir

Echo 1 > myID

Execute the following command to copy the file to the 232, 233 machine:
SCP-RQ zookeeper/192.168.1.232:/home/grid/soft/
SCP-RQ zookeeper/192.168.1.233:/home/grid/soft/

Log in to 232, 233 machines, enter the DataDir directory, change the value of myID to 2, 3, respectively

On the 231, 232, 233 machines, execute the following command to start zookeeper:
zkserver.sh start

On the 231, 232, 233 machines, perform the following commands to view the Zookeeper boot status:
zkserver.sh status

Zookeeper Cluster construction

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.