Introduction Zookeeper is a distributed, open source distributed application Coordination Service that is 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, including configuration maintenance, domain name services, distributed synchronization, group services, and so on.
The goal of zookeeper is to encapsulate complex and error-prone services that provide users with easy-to-use interfaces and performance-efficient, robust systems.
The zookeeper contains a simple set of primitives that provide both Java and C interfaces.
The Zookeeper code version provides a distributed, exclusive lock, election, queue interface, and the code is zookeeper-3.4.8\src\recipes. Where the distribution locks and queues have Java and C two versions, the election is only Java version.
DownloadApache Official Latest version is: 3.4.8: http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz
installationunzip to the specified directory D:\soft\zookeeper-3.4.8 Modify the Zoo_sample.cfg file name (D:\soft\zookeeper-3.4.8\conf) to Zoo.cfgmainly modify the log location, the specific configuration file is as follows:
# The number of milliseconds of each tick ticktime=2000 # The number of ticks, the initial # Synchroni Zation phase can take initlimit=10 # The number of ticks that can pass between # Sending a request and get Ting 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:\\zookeeper\\data Datalogdir=d:\\zookeeper\\log# The port at which the clients would connect clientport=2181 # The maximum number of the client connections. # Increase this if you need to handle more clients #maxClientCnxns =60 # # is sure to read the maintenance s Ection of the # Administrator guide before turning on Autopurge. # # # # # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance # # of Snapshots To retain in DataDir #autopurge. snapretaincount=3 # Purge Task interval in hours # Set to ' 0 ' to disable AU To purge feature #autopurge. purgeinterval=1
simple parsing of configuration files1, Ticktime: This time is as a Zookeeper server or between the client and the server to maintain heartbeat between the time interval, that is, each ticktime time will send a heartbeat.
2, DataDir: As the name implies is Zookeeper to save the data directory, by default, Zookeeper will write the data log file is also saved in this directory.
3, Datalogdir: As the name implies is Zookeeper save the log file directory
4, ClientPort: This port is the port that the client connects to the Zookeeper server, Zookeeper will listen to this port and accept the client's access request.
Startgo to the bin directory and start Zkserver.cmd, this script will start a Java process
after startup JPs can see the quorumpeermain process
You can also start a client connection
OK, installation successful, very simple
Zookeeper installing and using the Windows environment