Getting started with zookeeper (2) Interpreting the configuration items of zookeeper

Source: Internet
Author: User

Zooker Tutorials:

1
-How to deploy a zookeeper pseudo cluster/pseudo cluster on a single machine

2-Describe the configuration items of zookeeper

-----

The default configuration file of zookeeper is zookeeper/CONF/zoo_sample.cfg. You need to change it to zoo. cfg. The meaning of each configuration item is described as follows:

1. ticktime: CS communication heartbeat count

The heartbeat interval between zookeeper servers or between clients and servers, that is, each ticktime sends a heartbeat. Ticktime is measured in milliseconds.

tickTime=2000

2. initlimit: lf initial communication time limit
The maximum heartbeat count (the number of ticktime) that can be tolerated during the initial connection between the follower server (F) and leader server (l) in the cluster ).

initLimit=5

3. synclimit: lf synchronous communication time limit
The maximum number of Heartbeat requests and responses between the follower server and the leader server in the cluster (the number of ticktime ).

syncLimit=2

 
4. datadir: data file directory
Zookeeper stores the data directory. By default, Zookeeper stores the log files that write data in this directory.

dataDir=/home/michael/opt/zookeeper/data

5. datalogdir: log file directory
Directory where zookeeper saves log files.

dataLogDir=/home/michael/opt/zookeeper/log

6. clientport: Client Connection Port
The port connecting the client to the zookeeper server. zookeeper listens to this port and accepts the client's access requests.

clientPort=2333

7. Server Name and Address: cluster information (server number, server address, LF communication port, election port)
The writing format of this configuration item is special. The rules are as follows:

server.N=YYY:A:B

N indicates the server number, YYY indicates the Server IP address, and a indicates the LF communication port, indicating the port on which the server exchanges information with the leader in the cluster. B is the election port, indicating the port on which the Server communicates with each other when the new leader is elected (when the leader fails, other servers will communicate with each other and select the new leader ). Generally, port a of each server in the cluster is the same, and port B of each server is the same. However, when a pseudo cluster is used, the IP addresses are the same. Only port A and port B are different.
The following is an example of a non-pseudo cluster:

server.0=233.34.9.144:2008:6008server.1=233.34.9.145:2008:6008server.2=233.34.9.146:2008:6008server.3=233.34.9.147:2008:6008

The following is an example of a pseudo cluster:

server.0=127.0.0.1:2008:6008server.1=127.0.0.1:2007:6007server.2=127.0.0.1:2006:6006server.3=127.0.0.1:2005:6005

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.