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

Steps for linux to install zookeeper

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains "the steps of installing zookeeper in linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the steps of installing zookeeper in linux.

1. Install zookeeper, upload zookeeper to three servers, save it in / usr/local/zookeeper directory, and extract the tar package.

Tar-xzvf zookeeper-3.4.6.tar.gz

2. Create data and logs directories

Mkdir / usr/local/zookeeper/data

Mkdir / usr/local/zookeeper/logs

3. Enter the directory zookeeper-3.4.6, copy the zoo_sample.cfg file in the conf directory to zoo.cfg and modify it using the vi command

TickTime=2000

InitLimit=10

SyncLimit=5

ClientPort=2181

DataDir=/usr/local/zookeeper/zookeeper-3.4.6/data # Save data directory

DataLogDir=/usr/local/zookeeper/zookeeper-3.4.6/log # Save log directory

Server.1=192.168.0.101:2888:3888 # ip is the ip of the server

Server.2=192.168.0.102:2888:3888 # ip is the ip of the server

Server.3=192.168.0.103:2888:3888 # ip is the ip of the server

Note:

The data and log here need to create their own mkdir commands to create

4. Create a file in the / usr/local/zookeeper/zookeeper-3.4.6/data directory: myid

According to the server of configuration file on myid. The value of id in, and fill in the corresponding values in this file on different machines

The myid content of ip 192.168.0.101 is 1

The myid content of ip 192.168.0.102 is 2

The myid content of ip 192.168.0.103 is 3

Ip is the ip of the server. Here corresponds to the server.1,server.2,server.3 above.

5. Create an environment variable ZOOKEEPER and add it to the system path:

Vim / etc/profile

Add two lines before the export PATH statement:

ZOOKEEPER=/usr/local/zookeeper/zookeeper-3.4.6

PATH=$PATH:$ZOOKEEPER/bin

And execute source / etc/profile

6. If the installation is successful, test:

1. Enter the bin directory of zookeeper and execute sh zkServer.sh start to start zookeeper

two。 Check the status to enter the bin directory and execute sh zkServer.sh status

3. Stop entering the bin directory and execute sh zkServer.sh stop

At this point, I believe that you have a deeper understanding of the "steps to install zookeeper in linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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