Detailed configuration parameters (mainly%zookeeper_home%/conf/zoo.cfg files)

Source: Internet
Author: User
Tags zookeeper server memory

detailed configuration parameters (mainly%zookeeper_home%/conf/zoo.cfg files)

Name of parameter

Description

ClientPort

The port where the client connects to the server, which is the external service port, is generally set to 2181.

DataDir

The directory where the snapshot file snapshot is stored. By default, the transaction log is also stored here. It is recommended to configure parameter Datalogdir at the same time, the write performance of transaction log directly affects ZK performance.

Ticktime

A time unit in ZK. All the time in ZK is based on this time unit, and is configured in integer times. For example, the minimum timeout for sessions is 2*ticktime.

Datalogdir

The transaction log output directory. Try to configure the output of the transaction log with a separate disk or mount point, which will greatly enhance ZK performance.
(No Java system property)

Globaloutstandinglimit

Maximum request heap count. The default is 1000. When ZK runs, although the server is no longer idle to handle more client requests, it allows clients to submit requests to the server to improve throughput performance. Of course, to prevent server memory from overflowing, the request backlog is still limited.
(Java system property:zookeeper.globaloutstandinglimit. )

preallocsize

Advance disk space for subsequent writes to the transaction log. The default is 64M, and the size of each transaction log is 64M. If ZK has a larger snapshot frequency, it is recommended that this parameter be reduced appropriately. (Java system Property:zookeeper.preallocsize )

Snapcount

After each snapcount transaction log output, a snapshot (snapshot) is triggered, at which point ZK generates a snapshot.* file and creates a new transaction log file log.*. The default is 100000. (in real code implementations, a certain number of random numbers are processed to prevent all servers from taking snapshots at the same time and impacting performance) (Java system property:Zookeeper.snapcount )

tracefile

Log for all requests, which can be used during normal debugging, but is not recommended for production environments and can severely affect performance. (Java system property:? requesttracefile )

Maxclientcnxns

The limit of the number of connections between a single client and a single server is IP level, the default is 60, and if set to 0, there is no limit. Note that the limit is limited to the number of connections between a single client machine and a single ZK server, not to the specified client IP, nor to the ZK cluster, nor to the number of connections that a single ZK has to all clients. To specify a restriction policy for client IP, here's a patch that you can try: http://rdc.taobao.com/team/jm/archives/1334 (No Java system property)

clientportaddress

For multiple network card machines, you can specify a different listening port for each IP.  By default, all IP listens to the port specified by clientport . New in 3.3.0

Minsessiontimeoutmaxsessiontimeout

The session timeout limit, which is enforced to the maximum or minimum time if the client sets a timeout that is not in this range. The default session timeout is 2 * ticktime ~ ~ Ticktime This range New in 3.3.0

Fsync.warningthresholdms

When the transaction log output, if the call to the Fsync method exceeds the specified timeout, the warning message is printed in the log. The default is 1000ms. (Java system Property: Fsync.warningthresholdms ) New in 3.3.4

Autopurge.purgeinterval

As already mentioned in the 3.4.0 and later versions, ZK provides the ability to automatically clean up transaction logs and snapshot files, which specifies the cleanup frequency, in hours, by configuring a 1 or larger integer, and by default 0, which means that the automatic cleanup function is not turned on.  (No Java system property) New in 3.4.0

Autopurge.snapretaincount

This parameter is used in combination with the above parameter, which specifies the number of files that need to be retained. The default is to keep 3.  (No Java system property) New in 3.4.0

Electionalg

In previous releases, this parameter configuration allowed us to choose the leader election algorithm, but since in future releases there will only be a "tcp-based version of fast leader election" algorithm, so this parameter is not currently used, This is not a detailed start. (No Java system property)

Initlimit

Follower during startup, all the latest data is synchronized from leader, and then the starting state of the service can be determined. Leader allows F to complete this work within Initlimit time. Normally, we don't have to worry too much about setting this parameter. If the ZK cluster data volume is indeed very large, f at the start, the time to synchronize data from the leader will also be longer, so in this case, it is necessary to adjust the appropriate size of the parameter. (No Java system property)

Synclimit

During the operation, leader is responsible for communicating with all the machines in the ZK cluster, such as through some heartbeat detection mechanism, to detect the machine's survival status. If L send a heartbeat packet after Synclimit and haven't received a response from F, then the f is considered to be out of line. Note: Do not set this parameter too large, or it may mask some problems. (No Java system property)

leaderserves

By default, leader accepts client connections and provides normal read-write services. However, if you want leader to focus on the coordination of the machines in the cluster, you can set this parameter to no, which will greatly improve the performance of the write operation. (Java system Property:zookeeper. leaderserves ).

server.x=[hostname]:nnnnn[:nnnnn]

The x here is a number that is the same as the ID in the myID file. The right can be configured with two ports, the first port for data synchronization between F and L and other communications, and the second port is used to leader voting during the election process.
(No Java system property)

group.x=nnnnn[:nnnnn]weight.x=nnnnn

For machine grouping and weighting settings, see here (No Java system property)

Cnxtimeout

Leader during the election process, the timeout for opening a connection is 5s by default.  (Java system Property:zookeeper. cnxtimeout )

Zookeeper. Digestauthenticationprovider
. superdigest

ZK permission settings related, see " using Super identity to the right node to operate" and " zookeeper rights control "

Skipacl

No ACL checks are made on all client requests. If a permission limit is set on the previous node, it will fail once the beginning of the server is opened. (Java system Property: Zookeeper.skipacl )

Forcesync

This parameter determines whether the FileChannel. Force needs to be invoked when the transaction log is committed to ensure that the data is fully synchronized to disk. (Java system Property: Zookeeper.forcesync )

Jute.maxbuffer

The maximum amount of data per node is 1M by default. This restriction must be set on both the server and the client side to take effect. (Java system Property: Jute.maxbuffer )

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.