CentOS 7 installation and configuration of Zookeeper

Source: Internet
Author: User

CentOS 7 installation and configuration of Zookeeper

To learn about Dubbo, you need to use Zookeeper. Here we record the installation and configuration of Zookeeper in CentOS 7 Linux.

1. Download the zookeeper package: Official Address

2. Upload the package to linux and put it in the/usr/local directory. Of course, you can also store the package wherever it is, and decompress it to the/usr/local/zookeeper directory.

First, create the zookeeper folder.

Mkdir-p/usr/local/zookeeper

Decompress the zookeeper package to the zookeeper directory.

Tar-zxvf zookeeper-3.4.10.tar.gz-C zookeeper

3. first enter the/usr/local/zookeeper/zookeeper-3.4.10/conf directory

Cd/usr/local/zookeeper/zookeeper-3.4.10/conf

Assign a value to the zoo_sample.cfg file under the/usr/local/zookeeper/zookeeper-3.4.10/conf directory and rename it zoo. cfg,

Cp zoo_sample.cfg zoo. cfg

This zoo. cfg is the configuration file of zookeeper. Here I set up a standalone version. If you want to set up a cluster version, you can modify the configuration file.

Modify zoo. cfg

Enter the bin directory of zookeeper.

Cd/usr/local/zookeeper/zookeeper-3.4.10/bin

Start zookeeper

./ZkServer. sh start

The result is as follows:

Exploitation

./ZkServer. sh status

View the current zookeeper status

So far, the single-host version of zookeeper has been set up successfully.

4. Change zookeeper to startup

Go to the/etc/rc. d/init. d directory.

Cd/etc/rc. d/init. d

Create a file named zookeeper

Touch zookeeper

Edit the zookeeper File

Vi zookeeper

Press the I key to enter the insert mode and change the file

#! /Bin/bash
# Chkconfig: 2345 10 90
# Description: service zookeeper
Export JAVA_HOME =/usr/local/java/jdk1.8.0 _ 162
Export ZOO_LOG_DIR =/usr/local/zookeeper/zookeeper-3.4.10/logs
ZOOKEEPER_HOME =/usr/local/zookeeper/zookeeper-3.4.10
Su root $ {ZOOKEEPER_HOME}/bin/zkServer. sh "$1"

Then exit and save.

Add executable permissions to the new/etc/rc. d/init. d/zookeeper File

Chmod + x/etc/rc. d/init. d/zookeeper

Add the zookeeper script to the startup Item.

Chkconfig -- add zookeeper

Restart linux

Reboot

After restart

Service zookeeper status

Check whether zookeeper is started

The result is as follows:

Install Zookeeper-3.4.9 service https://www.bkjia.com/Linux/2016-09/135052.htm on CentOS7
ZooKeeper Overview 3.4.6 https://www.bkjia.com/Linux/2016-12/138025.htm
Build https://www.bkjia.com/Linux/2016-12/137958.htm in ZooKeeper 3.4.8 cluster environment under CentOS
Install https://www.bkjia.com/Linux/2017-01/139733.htm in Zookeeper cluster under CentOS 7
Distributed service Dubbo + Zookeeper Security Authentication https://www.bkjia.com/Linux/2017-12/149605.htm
Installing Zookeeper cluster https://www.bkjia.com/Linux/2017-01/139545.htm in Linux
Installation https://www.bkjia.com/Linux/2017-03/141400.htm of Zookeeper cluster in Linux

This article permanently updates link: https://www.bkjia.com/Linux/2018-03/151327.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.