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

Big data's zookeeper of Ecology (Cluster Construction)

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

Share

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

Note: zookeeper is written in Java, so jdk must be installed when installing zookeeper.

1. Cluster planning (here three servers)

cluster hosts

service

port

hadoop01

zookeeper

2181

hadoop02

zookeeper

2181

hadoop03

zookeeper

2181

2. download the installation package

Website: Download Address: mirrors.hust.edu.cn/apache

Version: ZooKeeper-3.4.7.tar.gz

3. Specific installation steps:

① Upload the installation package to any node of the cluster

② Decompress: tar -zxvf ZooKeeper-3.4.7.tar.gz -C /applications

③ Modify the corresponding configuration file

cd /application/ ZooKeeper-3.4.7/conf/

mv zoo_sample.cfg zoo.cfg

vim zoo.cfg

Detailed parameters:

Configuration parameter analysis:

tickTime=2000 #It is used to control heartbeats and timeouts, and by default the minimum session timeout is twice tickTime.

initLimit=10 #This configuration indicates that the follower ("client" as opposed to leader) is allowed to connect and synchronize to the leader's initial connection time, expressed as a multiple of tickTime. When the tickTime of the set multiple is exceeded, the connection fails.

syncLimit=5 #This configuration indicates the length of time between leader and follower to send messages, requests and responses

dataDir=/home/hadoop/apps/zkdata #Store the location of the database snapshot in memory (core data store location)

dataLogDir=/root/apps/zklog #Log Storage Directory

clientPort=2181 #Port number

#server.id= hostname: heartbeat port: election port (id is arbitrary, but cannot be repeated, between 1 and 255)

server.1=hadoop01:2888:3888

server.2=hadoop02:2888:3888

server.3=hadoop03:2888:3888

④ Distribution of installation packages

cd /applications

scp -r ZooKeeper-3.4.7/ hadoop@hadoop02:$PWD

scp -r ZooKeeper-3.4.7/ hadoop @hadoop03:$PWD

④ Final step configuration

In each node in the cluster, set:

mkdir /home/hadoop/apps/zkdata #Create zookeeper's core data directory (not created by default)

cd /home/hadoop/apps/zkdata

echo num > myid (num is the ID you configured in zoo.cfg on different nodes)

Configuring environmental variables

sudo vim /etc/profile

export ZOOKEEPER_HOME=/home/hadoop/apps/ZooKeeper-3.4.7

export PATH=$PATH:$ZOOKEEPER_HOME/bin

source /etc/profile

4. Start the cluster and test whether the cluster installation is successful

Executed at various points: zkServer.sh start

Check if the startup is successful: jps Check if there is: QuarumPeerMain process

zkServer.sh status; View the status of individual nodes

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