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

Deploy zookeeper distributed nodes

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

Deploy 3 zookeeper distributed nodes with 2 servers and low resources:

1. Prepare the environment

The system has been configured with the JAVA environment

Download a version of the zookeeper package

Download link: http://apache.claz.org/zookeeper/zookeeper-3.5.3-beta/zookeeper-3.5.3-beta.tar.gz

2. Planning

Server A, deploy 1 instance

Server B, deploy 2 instances

3. We configure three services, and a distributed cluster requires at least three instance services. The configuration information is as follows:

Create a new data directory for each service log

Server A:

/ opt/local/zookeeper/zk, create data and logs, create a new myid in data, and write 3 in it

Server B:

/ opt/local/zookeeper/zk1, create data and logs, create a new myid in data, and write 2 in it

/ opt/local/zookeeper/zk2, create a new data and logs, create a new myid in data, and write 1 in it

4. Configuration file directory / opt/local/zookeeper-3.4.10/conf

Create 3 new profiles for

Server A: zoo.cfg

Server B: zoo1.cfg, zoo2.cfg

The ports are 2181 2182 2183 respectively

TickTime=2000initLimit=10syncLimit=5dataDir=/opt/local/zookeeper/zk/dataclientPort=2181dataLogDir=/opt/local/zookeeper/zk/logsserver.1=IP1:2287:3387server.2=IP2:2288:3388server.3=IP2:2289:3389

First explain the meaning of server.x=A:B:C:

X: represents the contents of the myid under the dataDir used by each service instance

A: the IP address of the machine where the peer service resides

B: leader election port (all ports should not be the same in pseudo-distributed environment)

C: the port of communication between zk servers and the synchronization information between servers

5 、

Start three services:

Bin/zkServer.sh start conf/zoo.cfg bin/zkServer.sh start conf/zoo1.cfg bin/zkServer.sh start conf/zoo2.cfg

View service status:

# Mode: followerbin/zkServer.sh status conf/zoo.cfg # Mode: leaderbin/zkServer.sh status conf/zoo1.cfg # Mode: followerbin/zkServer.sh status conf/zoo2.cfg

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