Start Standalone ZooKeeper Server

Q

How to start standalone ZooKeeper Server?

✍: FYIcenter.com

A

If you want to start a standalone ZooKeeper Server on Linux or Mac computer, you can follow these steps:

1. Download a binary package of Apache ZooKeeper like apache-zookeeper-3.7.0-bin.tar.gz.

2. Unzip and untar the package file. You see all files extracted in /fyicenter/apache-zookeeper-3.7.0-bin folder.

3. Create a configuration file.

fyicenter$ cd apache-zookeeper-3.7.0-bin

fyicenter$ cp conf/zoo_sample.cfg conf/zoo.cfg 

fyicenter$ vi conf/zoo_sample.cfg
  ...
  dataDir=/var/zookeeper
  clientPort=2181

4. Create the data directory specified in the configuration.

fyicenter$ sudo mkdir /var/zookeeper 
fyicenter$ sudo chmod 777 /var/zookeeper 

5. Start the ZooKeeper server.

fyicenter$ bin/zkServer.sh start

/usr/bin/java
ZooKeeper JMX enabled by default
Using config: conf/zoo.cfg
Starting zookeeper ... STARTED

6. Confirm that ZooKeeper server is running.

fyicenter$ bin/zkServer.sh status

/usr/bin/java
ZooKeeper JMX enabled by default
Using config: conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Mode: standalone

 

Run ZooKeeper Client Commands

Using Apache ZooKeeper

Using Apache ZooKeeper

⇑⇑ FAQ for Apache ZooKeeper

2022-03-29, 900🔥, 0💬