1.
1.1 Create four virtual machines and start:
1.2 Create a centos7 folder in the shell and put four sessions in it, note1, note2, note3, note4
1.3 Successful establishment
2. Start configuration
2.1: Modify the hostname: hostnamectl set-hostname hostname --static (permanent)
Reboot: reboot
View hostname: hostname
2.2 Turn off the firewall
When entering service iptables stop, I get the following error:
Then you need to install an iptables-service:
systemctl stop firewalld
systemctl mask firewalld
yum install iptables-services (installation)
systemctl stop iptables (turn on and off)
service iptables save(保存)
2.3: Set the sync button
2.4 Create the zookeeper folder
2.5 Click xftp6, open the zookeeper-bin file you want to transfer,
2.6 zookeeper download address:
https://mirrors.cloud.tencent.com/apache/zookeeper/zookeeper-3.5.7/
2.7note1,note2,note3, all use this method to upload
2.8 : 解压 : tar -zxvf apache-zookeeper-3.5.7-bin.tar.gz
2.9 Rename:
mv apache-zookeeper-3.5.7-bin apache-zookeeper
delete the tar package
Enter data, create and enter myid, modify the content inside
Write 0, 1, and 2 in myid respectively. i, modify; esc exit: wq! Force save and exit
Enter apache-zookeeper
3. Modify the zookeeper configuration file:
3.1: Enter conf``[root@note1 apache-zookeeper]# cd conf/```
复制zoo_sample.cfg,给zoo.cfg。[root@note1 conf]# cp zoo_sample.cfg zoo.cfg
修改配置文件zoo.cfg 。 [root@note1 conf]# vim zoo.cfg
zoo.cfg配置文件:
dataDir=/data/zookeeper/data
server.0=note1:2888:3888
server.1=note2:2888:3888
server.2=note3:2888:3888
# 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=/data/zookeeper/data
# 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=note1:2888:3888
server.1=note2:2888:3888
server.2=note3:2888:3888
3.2:启动zookeeper[root@note1 apache-zookeeper]# bin/zkServer.sh start
View status: [root@note1 apache-zookeeper]# bin/zkServer.sh status
jps start: jps
3.3 Access note1:8080 on the browser (Firefox)
3.4
Complete the zookeeper configuration
3.4 :
View the log vim logs/zookeeper-root-server-note1.out
Distribution files: scp -r apache-zookeeper/root@note2$pwd scp -r apache-zookeeper/root@note3$pwd
Tags: cfg, note1, root, zookeeper, zoo, linux, apache, installation
Source: https://blog.csdn.net/XIAOMO__/article/details/104802404