编程知识 cdmana.com

Installation and configuration of zookeeper in Windows Environment

Windows Installation in environment Zookeeper

To configure JDK

Zookeeper Start up depends on JDK Environmental Science , You can refer to :Java And JDK To configure

Download decompression

Download address :https://downloads.apache.org/zookeeper/

Unzip to the right address , I'll extract it here :D:\softs\zookeeper-3.4.13.

The configuration file

Get into D:\softs\zookeeper-3.4.13\conf Under the table of contents ,Zookeeper Already available zoo_sample.cfg The document provides reference examples , Let's make a copy called zoo.cfg, The configuration file is modified as follows : Be careful dataDir and dataLogDir It can be modified according to the actual situation .

# The number of milliseconds of each tick
# Zookeeper  The time interval between services or between client and server to maintain heartbeat , Every tickTime Time will send a heartbeat , In Milliseconds 
tickTime=2000

# The number of ticks that the initial 
# synchronization phase can take
# Leader-Follower  Initial communication time limit 
#  In the cluster  follower  The server (F) And  leader  The server (L) The maximum number of heartbeats that can be tolerated during the initial connection between (tickTime  The number of ).
initLimit=10

# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
# Leader-Follower  Synchronous communication time limit 
#  In the cluster  follower  The server and  leader  The maximum number of heartbeats that can be tolerated between requests and responses between servers (tickTime The number of ).
syncLimit=5

# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
#  Modify... According to the actual situation  dataDir Save the data ,dataLogDir Save the log file 
dataDir=D:\\softs\\zookeeper-3.4.13\\datas 
dataLogDir=D:\\softs\\zookeeper-3.4.13\\logs

# the port at which the clients will connect
#  Client connection port  Zookeeper Will listen to this port , Accept client access requests 
clientPort=2181

# the maximum number of client connections.
# increase this if you need to handle more clients
#  Maximum number of client connections allowed 
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

Start the test

Now the configuration is complete , Get into bin Catalog , perform zkserver.cmd You can start the server .

It will be automatically generated after startup datas and logs Catalog .

Test connection : Also in bin Under the table of contents , perform zkCli.md Start client , appear Welcome to Zookeeper On behalf of the success of the start .

Reference resources

版权声明
本文为[Tian Qiao Ba Xia]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201225115815198A.html

Scroll to Top