What is Zookeeper:
ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. - https://zookeeper.apache.org/
There are several ways to test the zookeeper service
Option 1: Jps
Zookeeper is a Java process and when you start a Zookeeper instance it runs a org.apache.zookeeper.server.quorum.QuorumPeerMain class. So you can check for a running Zookeeper like this:
Option 2: using zookeeper command
Zookeeper provides a number of 4 letter word commands. You can run them like below.
2181 is the standard port for zookeeper service.
View the full list of available zookeeper commands in the following link
envi: Print details about serving environment
reqs: List outstanding requests
ruok: Tests if server is running in a non-error state. The server will respond with imok if it is running. Otherwise it will not respond at all.
stat: Lists statistics about performance and connected clients.
Option 3: checking linux service
Zookeeper runs as linux daemon. You can check the status of the service.
Configuration file for zookeeper
zkCli - Zookeeper CLI
Launch zookeeper cli as below. You can view services that are configured using zkCli
Get metadata for /hbase application
In theoretical computer science, the CAP theorem, also named Brewer's theorem after computer scientist Eric Brewer, states that it is impossible for a distributed computer system to simultaneously provide all three of the following guarantees:
Consistency (all nodes see the same data at the same time)
Availability (every request receives a response about whether it succeeded or failed)
Partition tolerance (the system continues to operate despite arbitrary partitioning due to network failures)
Zookeeper relaxes availability over consistency and partition tolerance.