Installation and use of zookeeper in windows environment

1. Introduction
        zooKeeper is a distributed, open source distributed application coordination service, an open source implementation of Google's Chubby, and an important component of Hadoop and Hbase. It is a software that provides consistent services for distributed applications. The functions provided include: configuration maintenance, domain name service, distributed synchronization, group service, etc.
        The goal of zooKeeper is to encapsulate complex and error-prone key services, and provide users with easy-to-use interfaces and systems with high performance and stable functions.
        zooKeeper contains a simple set of primitives that provide Java and C interfaces.
        In the zooKeeper code version, interfaces for distributed exclusive locks, elections, and queues are provided. The code is in zookeeper-3.4.8\src\recipes. There are two versions of distributed locks and queues in Java and C, and only the Java version is available for elections.

 

2. Download
        the official Apache download, download address: https://www.apache.org/dyn/closer.cgi/zookeeper/

 

3. Installation
  Unzip it to the specified directory D:\software\zookeeper-3.4.11
  Modify the file name of zoo_sample.cfg (D:\soft\zookeeper-3.4.8\conf)
  Mainly modify the log location for zoo.cfg, the specific configuration The files are as follows:

# 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.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=D:\\software\\zookeeper-3.4.11\\data
dataLogDir=D:\\software\\zookeeper-3.4.11\\log
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#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

Simple analysis of the configuration file
  1. tickTime: This time is used as the time interval for maintaining heartbeats between zookeeper servers or between the client and the server, that is, a heartbeat will be sent every tickTime.
  2. dataDir: As the name implies, it is the directory where zookeeper saves data. By default, Zookeeper also saves log files for writing data in this directory.
  3.dataLogDir: As the name implies, it is the directory where zookeeper saves log files.
  4.clientPort: This port is the port through which the client connects to the zookeeper server. Zookeeper will listen to this port and accept client access requests.

 

4. Start
  Enter the bin directory and start zkServer.cmd, a java process will be started in this script.

  After startup, jps can see the process of QuorumPeerMain.

  You can also start the client to connect

  OK, the installation is successful, very simple.

 

Reference article: https://blog.csdn.net/tlk20071/article/details/52028945

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324614200&siteId=291194637