Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up a zookeeper quorum?

I have an issue with the below given statement. I haven't tried executing the statement as I didn't understand what is this used for

What should I pass as arguments for server.1, zoo1

server.1=zoo1:2888:3888     
server.2=zoo2:2888:3888
server.3=zoo3:2888:3888

What does the above statement mean

What values should I pass and what is the above statement used for

Can u explain with an example

I have a cluster of 4 computers with high availability enabled

Machine 1 and 2 - Zookeeper, zkfc, Namenode, Resourcemanager, Journal node
Machine3 - Zookepper, Journal node
Machine4 - Datanode

Kindly help

like image 956
Jon Andrews Avatar asked Sep 19 '25 17:09

Jon Andrews


1 Answers

These entries define the quorum of Zookeeper servers.

server.1=zoo1:2888:3888     
server.2=zoo2:2888:3888
server.3=zoo3:2888:3888

And they follow the pattern,

server.X=server_name:port1:port2

server.X, where X is the server number in ASCII. Create a file named as myid under the Zookeeper data directory in each Zookeeper server. This file should contain the server number X as an entry in it.

server_name is the hostname of the node where the Zookeeper service is started.

port1, ZooKeeper server uses this port to connect followers to the leader.

port2, this port is used for leader election.

When a new leader arises, a follower opens a TCP connection to the leader using this port. Because the default leader election also uses TCP, we currently require another port for leader election. This is the second port in the server entry.

like image 126
franklinsijo Avatar answered Sep 22 '25 22:09

franklinsijo