Rapid Construction and experience of ZooKeeper
Apache ZooKeeper is a high-performance coordination server for distributed applications. For its specific introduction, such as naming and configuration management, synchronization and group services, please use your own Google. Although I have heard of ZooKeeper for a long time, it is only recently that ZooKeeper is used internally in Kafka in the project, which prompted me to start to understand what ZooKeeper is. ZooKeeper is born out of the famous project Hadoop. Like Hazelcast, it does not adopt the strict Master-Slave cluster mode, but selects Leader dynamically, which avoids the problem of single point of failure.
Since it is a cluster, the actual application will start the service on different machines. Now with docker, it is easy to use it to test multi-host environment, just use docker search zookeeper. This example does not involve docker, but uses multiple ports to start three ZooKeeper instances in the same system for testing. Take Mac/Linux as an example:
Download and install ZooKeeper
When you go to https://zookeeper.apache.org/releases.html#download to download, the latest stable version when you write this article is zookeeper-3.4.9.tar.gz. After downloading, extract it somewhere. For convenience, add the decompressed zookeeper-3.4.9/bin to the system environment variable $PATH, and then run commands like zkServer.sh and zkCli.sh at any time. Read the full text > >