Fat gaga I 2022-01-27 00:43:06 阅读数:104

apacher-zookeeper apacher zookeeper

Premise : Turn off firewall

1、 decompression

cd /opt/module/tar -zxvf apache-zookeeper-3.5.5-bin.tar.gz

2、 Create data files and catalog files

stay zookeeper Create two folders under the following directory data and log

cd /opt/module/apache-zookeeper-3.5.5-bin/
mkdir data
mkdir log

3、 Copy configuration file

cd /opt/module/apache-zookeeper-3.5.5-bin/conf/
cp zoo_sample.cfg zoo.cfg

Profile changes

# The number of milliseconds of each tick


# The number of ticks that the initial

# synchronization phase can take


# The number of ticks that can pass between

# sending a request and getting an acknowledgement


# the directory where the snapshot is stored.

# do not use /tmp for storage, /tmp here is just

# example sakes.



# the port at which the clients will connect


# the maximum number of client connections.

# increase this if you need to handle more clients



# Be sure to read the maintenance section of the

# administrator guide before turning on autopurge.


# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance


# The number of snapshots to retain in dataDir


# Purge task interval in hours

# Set to "0" to disable auto purge feature

# autopurge.purgeInterval=1


4、 Create a server myid

stay data Create one in the directory myid The file of , The value inside can be given any value , But with the above services server.x Corresponding

cd /opt/module/apache-zookeeper-3.5.5-bin/data/touch myid

5、 Cluster copy

scp -r /opt/module/apache-zookeeper-3.5.5-bin [email protected]:/opt/module/apache-zookeeper-3.5.5-bin
scp -r /opt/module/apache-zookeeper-3.5.5-bin [email protected]:/opt/module/apache-zookeeper-3.5.5-bin

6、 colony myid change

Go to each node , modify myid value

Add the cluster system environment variable :

vi /etc/profile

export ZOOKEEPER_HOME=/opt/module/apache-zookeeper-3.5.5-bin


Save system environment variables :

source /etc/profile

Turn off the cluster firewall

Cluster start :

Go to each node and start :

cd /opt/module/apache-zookeeper-3.5.5-bin
zkServer.sh start
zkServer.sh status

zkCli Connection verification :

zkCli.sh -server hadoop100:2181

copyright:author[Fat gaga I],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/01/202201270043052883.html