Support Support Downloads Knowledge Base Service Request Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Contrail] Zookeeper configuration file and common parameters

0

0

Article ID: KB35226 KB Last Updated: 16 Nov 2019Version: 1.0
Summary:

This article provides a simple explanation about Zookeeper's configuration file, zoo.cfg and the typical parameters. Understanding these parameters will help you verify Zookeeper configuration files and find out any possible errors during troubleshooting. 

Solution:

For Contrail 3.2.8 cluster, by default, Zookeeper configuration files are under /etc/zookeeper/conf/. Below is an example of /etc/zookeeper/conf/zoo.cfg.

======================================================================
# cat /etc/zookeeper/conf/zoo.cfg 
# http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.html

# The number of milliseconds of each tick
tickTime=2000

# The number of ticks that the initial 
# synchronization phase can take
initLimit=10

# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5

# the directory where the snapshot is stored.
dataDir=/var/lib/zookeeper

# Place the dataLogDir to a separate physical disc for better performance
# dataLogDir=/disk2/zookeeper

# the port at which the clients will connect
clientPort=2181

# specify all zookeeper servers
# The fist port is used by followers to connect to the leader
# The second one is used for leader election

# To avoid seeks ZooKeeper allocates space in the transaction log file in blocks of preAllocSize kilobytes. The default block size is 64M. One reason for changing the size of the blocks is to reduce the block size if snapshots are taken more often. (Also, see snapCount).
#preAllocSize=65536

# Clients can submit requests faster than ZooKeeper can process them, especially if there are a lot of clients. To prevent ZooKeeper from running out of memory due to queued requests, ZooKeeper will throttle clients so that there is no more than globalOutstandingLimit outstanding requests in the system. The default limit is 1,000.ZooKeeper logs transactions to a transaction log. After snapCount transactions are written to a log file a
# snapshot is started and a new transaction log file is started. The default snapCount is 10,000.
#snapCount=1000

# If this option is defined, requests will be will logged to a trace file named traceFile.year.month.day. 
#traceFile=

# Leader accepts client connections. Default value is "yes". The leader machine coordinates updates. For higher update throughput at thes slight expense of read throughput the leader can be configured to not accept clients and focus on coordination.
#leaderServes=yes

maxSessionTimeout=4000000
autopurge.purgeInterval=3
server.1=172.18.101.101:2888:3888
server.2=172.18.101.102:2888:3888
server.3=172.18.101.103:2888:3888
======================================================================

During troubleshooting, you must know what each parameter can do before deciding whether it is related to the issue you are seeing and what is the correct way to tweak the zookeeper ensemble. The meaning of each parameter is shown below: 

  • tickTime: The tick is the basic unit of measurement for time in milliseconds used by ZooKeeper.
  • initLimit: The timeout for a follower to initially connect to a leader, its value is in number of tickTime.
  • syncLimit: The timeout for a follower to sync up with the leader, also its value is in number of tickTime.
  • dataDir: The directory where all the zookeeper data is stored, including both transaction logs and snapshots. 
  • dataLogDir: The directory where zookeeper transaction logs are stored, this value will override dataDir value only for transaction logs. 
  • clientPort: The TCP port number opened for clients, by default 2181
  • preAllocSize: The preallocated transaction log file size in kB.
  • snapCount: The number of transcations before zookeeper taking a new snapshot. 
  • traceFile: Allows detailed trace of zookeeper operations with trace files
  • leaderServes: Indicates whether or not the leader of zookeeper ensemble need to serve clients. 
  • maxSessionTimeout: Maximum timeout for all sessions. 
  • autopurge.purgeInterval: How long should zookeeper wait before purging old logs and snapshots, the unit of this interval is hour.

Finally, we have a list of zookeeper servers in zoo.cfg to specify the server ID, IP address and internal connection port. The following example specifies host 172.18.101.101 as server with ID 1, and port 2888 and 3888 as port for transaction connection and leader election connection. 

server.1=172.18.101.101:2888:3888 

The best practice is to keep values of these parameters the same across the ensemble. 

For more on troubleshooting Zookeeper, refer to KB31144 - Contrail Getting Started - Administration, Configuration & Troubleshooting (JumpStation)
Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Security Alerts and Vulnerabilities

Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search