Fat gaga I 2022-01-27 00:43:06 阅读数:104
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
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/opt/module/apache-zookeeper-3.5.5-bin/data
dataLogDir=/opt/module/apache-zookeeper-3.5.5-bin/log
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# 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
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
# autopurge.purgeInterval=1
server.0=192.168.1.100:2888:3888
server.1=192.168.1.101:2888:3888
server.2=192.168.1.102:2888:3888
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
export PATH=$PATH:$ZOOKEEPER_HOME/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