Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Zookeeper environment installation

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Download Zookeeper source package

Http://mirror.bit.edu.cn/apache/zookeeper/

1. Cluster environment

Master 192.168.2.100

Slave1 192.168.2.101

Slave2 192.168.2.102

two。 Download the software package

# Master

Wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.5.3/zookeeper-3.5.3.tar.gz

Tar zxvf zookeeper-3.5.3.tar.gz

3. Modify zookeeper configuration

# Master

Cd zookeeper-3.5.3

# create log folder and data folder

Mkdir data

Mkdir log

# modify configuration

Cd conf

Mv zoo_sample.cfg zoo.cfg

Vim zoo.cfg

DataDir=/usr/local/zookeeper-3.5.3-beta/data

DataLogDir=/usr/local/zookeeper-3.5.3/log

Server.1=master:2888:3888

Server.2=slave1:2888:3888

Server.3=slave2:2888:3888

4. Configure environment variables

# Master 、 Slave1 、 Slave2

Vim / .bashrc

ZOOKEEPER_HOME=/usr/local/zookeeper-3.5.3

PATH=$PATH:$ZOOKEEPER_HOME/bin

# refresh environment variables

Source / .bashrc

5. Copy installation package

# Master

Scp-r / usr/local/zookeeper-3.5.3 root@slave1:/usr/local/zookeeper-3.5.3

Scp-r / usr/local/zookeeper-3.5.3 root@slave2:/usr/local/zookeeper-3.5.3

6. Add ID separately

ID should correspond to the number in the server.* in the configuration file

# Master

Echo "1" > / usr/local/zookeeper-3.5.3/data/myid

# Slave1

Echo "2" > / usr/local/zookeeper-3.5.3/data/myid

# Slave2

Echo "3" > / usr/local/zookeeper-3.5.3/data/myid

7. Start the Zookeeper service

# Master 、 Slave1 、 Slave2

Slave1 and Slave2 will also execute this command.

ZkServer.sh start

8. View running status

ZkServer.sh status

# Master

# Slave1

# Slave2

9. Process status

Jps

# Master # Slave1 # Slave2

10. Shut down the cluster

# master 、 Slave1 、 Slave2

ZkServer.sh stop

All three machines will execute this command.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report