Hadoop (vi)-Zookeeper installation and configuration

Source: Internet
Author: User

I. Zookeeper configuration

1. Upload ZK installation package using WINSCP

Zookeeper-3.4.5.tar.gz


2. Unzip the installation package TAR-ZXVF zookeeper-3.4.5.tar.gz-c /itcast

3. Configuration (first configured on a single node)
3.1 Adding a zoo.cfg configuration file
Enter $ZOOKEEPER/conf
Performing MV Zoo_sample.cfg zoo.cfg

3.2 Modifying a configuration file (zoo.cfg)
Datadir=/itcast/zookeeper-3.4.5/data
server.5=itcast05:2888:3888
server.6=itcast06:2888:3888
server.7=itcast07:2888:3888

3.3 In (Datadir=/itcast/zookeeper-3.4.5/data)

Create a myID file with the contents of server. N in N (the content of SERVER.2 is 2)

echo "5" > myID

3.4 Copy the configured ZK to the other nodes
Scp-r/itcast/zookeeper-3.4.5/itcast06:/itcast/
Scp-r/itcast/zookeeper-3.4.5/itcast07:/itcast/

3.5 Note: Be sure to modify the contents of myID on other nodes
In itcast06 should change the contents of myID to 6 (echo "6" > myID)
In itcast07 should change the contents of myID to 7 (echo "7" > myID)

4. Start the cluster

Start ZK separately./zkserver.sh start


Two. configuration file zoo.cfg

1.ticktime:cs Communication Heartbeat Time
The time interval between Zookeeper servers or between the client and server to maintain a heartbeat, that is, each ticktime time sends a heartbeat.

The ticktime is measured in milliseconds.
ticktime=2000

2.initlimit:lf Initial communication time limit
The maximum number of heartbeats (ticktime) that can be tolerated by the initial connection between the follower server (F) in the cluster and the leader Server (L).
Initlimit=5

3.SYNCLIMIT:LF Synchronous Communication time limit
The maximum number of heartbeats (ticktime) that can be tolerated between the follower server in the cluster and the leader server between requests and responses.
synclimit=2

4.dataDir: Data File directory
Zookeeper the directory where the data is stored, by default zookeeper log files that write the data are also stored in this directory.
Datadir=/home/michael/opt/zookeeper/data

5.clientPort: Client Connection port
The client connects to the port of the Zookeeper server, and Zookeeper listens to the port, accepting requests for client access.
clientport=2181

6. Server name and Address: Cluster information (server number, server address, LF communication port, election port)
This configuration item is written in a special format, with the following rules:
Server. N=yyy:a:b
server.1=itcast05:2888:3888
server.2=itcast06:2888:3888
server.3=itcast07:2888:3888


Hadoop (vi)-Zookeeper installation and configuration

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.