How to install Zookeeper service on Linux system

How to install Zookeeper service on Linux system

1. Create the /usr/local/services/zookeeper folder:

  mkdir -p /usr/local/services/zookeeper

2. Enter the /usr/local/services/zookeeper directory:

  cd /usr/local/services/zookeeper

3. Download zookeeper-3.4.9.tar.gz:

 wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz

4. Unzip zookeeper-3.4.9.tar.gz:

  tar -zxvf zookeeper-3.4.9.tar.gz

5. Enter the /usr/local/services/zookeeper/zookeeper-3.4.9/conf directory:

cd zookeeper-3.4.9/conf/

6. Copy the zoo_sample.cfg file and name it zoo.cfg:

cp zoo_sample.cfg zoo.cfg

7. Use vim to open the zoo.cfg file and modify its content as follows:

# The number of milliseconds of each tick
    # The benchmark time interval defined by zookeeper, unit: milliseconds 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=/tmp/zookeeper
   #Data folder dataDir=/usr/local/services/zookeeper/zookeeper-3.4.9/data
   # Log folder dataLogDir=/usr/local/services/zookeeper/zookeeper-3.4.9/logs
   # the port at which the clients will connect
   # The port number for the client to access zookeeper is 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

8. Save and close the zoo.cfg file:

9. Enter the /usr/local/services/zookeeper/zookeeper-3.4.9/bin directory:

cd ../bin/

10. Use vim to open the profile configuration file in the /etc/ directory:

vim /etc/profile

And append the following content at the end:

 # idea - zookeeper-3.4.9 config start - 2016-09-08
   export ZOOKEEPER_HOME=/usr/local/services/zookeeper/zookeeper-3.4.9/
   export PATH=$ZOOKEEPER_HOME/bin:$PATH
   export PATH
   # idea - zookeeper-3.4.9 config start - 2016-09-08

11. Make the profile file in the /etc/ directory effective:

 source /etc/profile

12. Start the zookeeper service:

zkServer.sh start

If the following information is printed, it indicates that the startup is successful:

  ZooKeeper JMX enabled by default
   Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
   Starting zookeeper ... STARTED

13. Query the zookeeper status:

  zkServer.sh status

14. Shut down the zookeeper service:

 zkServer.sh stop

If the following information is printed, it indicates successful closure:

 ZooKeeper JMX enabled by default
   Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
   Stopping zookeeper ... STOPPED

15. Restart the zookeeper service:

zkServer.sh restart

If the following information is printed, it indicates that the restart is successful:

  ZooKeeper JMX enabled by default
   Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
   ZooKeeper JMX enabled by default
   Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
   Stopping zookeeper ... STOPPED
   ZooKeeper JMX enabled by default
   Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
   Starting zookeeper ... STARTED

Summarize

The above is the introduction of installing Zookeeper service in Linux. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Zookeeper connection timeout problem and solution to connection rejection
  • Which is better, Zookeeper or Eureka?
  • Zookeeper Overview Detailed Illustrations
  • Detailed explanation of zookeeper node types
  • Detailed explanation of the principle of zookeeper listener
  • How to extract the zookeeper address from the dubbo zookeeper registration address
  • Tutorial on installing Zookeeper on Linux and starting and shutting down
  • Detailed explanation of how to build services using dubbo+zookeeper+spring boot
  • How to use Zookeeper to build a configuration center in SpringCloud
  • Some suggestions for optimizing zookeeper service

<<:  MySQL InnoDB monitoring (system layer, database layer)

>>:  JavaScript to achieve a simple page countdown

Recommend

Detailed explanation of Vue form binding and components

Table of contents 1. What is two-way data binding...

Nexus private server construction principle and tutorial analysis

one. Why build a Nexus private server? All develo...

How to compile and install PHP and Nginx in Ubuntu environment

This article describes how to compile and install...

The difference between Display, Visibility, Opacity, rgba and z-index: -1 in CSS

We often need to control the hidden, transparent ...

MySQL 5.7.18 installation tutorial under Windows

This article explains how to install MySQL from a...

Deleting files with spaces in Linux (not directories)

In our daily work, we often come into contact wit...

Detailed explanation of the process of using docker to build minio and java sdk

Table of contents 1minio is simple 2 Docker build...

HTML+CSS to create heartbeat special effects

Today we are going to create a simple heartbeat e...

mysql5.5 installation graphic tutorial under win7

MySQL installation is relatively simple, usually ...

Detailed explanation of props and context parameters of SetUp function in Vue3

1. The first parameter props of the setUp functio...

MySQL8.0.18 configuration of multiple masters and one slave

Table of contents 1. Realistic Background 2. Agre...

Vue implements bottom query function

This article example shares the specific code of ...