ZooKeeper cluster under Linux

ZooKeeper Cluster
Server 1: 10.26.211.95 Port: 2181, 2881, 3881
Server 2: 10.26.211.25 Port: 2181, 2881, 3881 Server
3: 10.26.211.55 Port: 2181, 2881, 3881 / hosts file , add IP and

hostname
mapping /zookeeper-3.3.6/data dataLogDir=/usr/local/zookeeper-3.3.6/logs clientPort=2181 maxClientCnxns=3000 server.1=slave-01:2881:3881 server.2=slave-02:2881:3881 server.3=slave-03:2881:3881 3. The configuration explanation of the server in the zoo.cfg configuration file is helpful for understanding. server.A=B:C:D A is a number, indicating which server this is the number;


















B is the IP address of the server (or the host name mapped to the IP address);
C is the first port used for information exchange among cluster members, indicating the port through which this server exchanges information with the leader server in the cluster;
D is

4. Create a folder
mkdir data
mkdir logs in the zookeeper-3.3.6 directory 5. Create under dataDir

=/usr/local/zookeeper-3.3.6/data myid file
10.26.211.95 server
touch myid
echo 1 > /usr/local/zookeeper-3.3.6/data/myid

10.26.211.25 server
touch myid
echo 2 > /usr/local/zookeeper-3.3.6/data/myid

10.26. 211.55 server
touch myid
echo 3 > /usr/local/zookeeper-3.3.6/data/myid

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326514029&siteId=291194637