1: View current server IP:
# ifconfig
Scenario 1: Direct view of your ip:192.168.164.130
Scenario 2: Can't see your own IP ( but can see ifcfg-beginning of things, such as: ifcfg-eno16777736[me is this], remember it )
Modify vi/etc/sysconfg/network-scripts/ifcfg-eno16777736 (your network card file, beginning with ifcfg-, followed by a string of random numbers)
Modify Onboot=no to Onboot=yes
#:wq save after the $ ifconfig, you can see your IP.
2: Modify the Host file Vi/etc/hosts, add at the end of the file:
192.168.164.130 ( your server IP, which you will use later in this procedure ) meeting-provider-01
3: Download zookeeper-3.4.6 to http://apache.fayea.com/zookeeper/(you already have the ability to omit this step):
# wget http://apache.fayea.com/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
4: Unzip the Zookeeper installation package:
TAR-ZXVF zookeeper-3.4.6.tar.gz
5: Create the following two directories under/home/currently logged in user/zookeeper-3.4.6 directory:
# mkdir Data
# mkdir Logs
6: Copy the Zoo_sample.cfg file in the zookeeper-3.4.6/conf directory, named: zoo.cfg (zookeeper default is this configuration file):
$ CP zoo_sample.cfg Zoo.cfg
7: Modify the zoo.cfg configuration file:
# VI Zoo.cfg
Modify the following three configurations (with or without a new one):
datadir=/home/current logged on user/zookeeper-3.4.6/data
datalogdir=/home/current logged on user/zookeeper-3.4.6/logs
#2888是zookeeper服务之间通信的端口, 3888 is the port zookeeper communicates with other applications, and meeting.provider-01 is a mapped IP host in the hosts
server.1=meeting.provider-01:2888:3888
8: Create myID file under/home/currently logged on user/zookeeper-3.4.6/data/:
Edit the myID file and enter the corresponding number on the corresponding IP machine, such as on zookeeper, the content of the myID file is 1. If the installation is configured only on a single node, then there is only one Server.1
# VI myID
1
9: Switch to the current logged-on user under ($ su "currently logged in user")
Modify/home/currently logged on user/.bash_profile ($ vi/home/currently logged in user/.bash_profile) file, add Zookeeper configuration:
Export zookeeper_home=/home/currently logged on user/zookeeper-3.4.6
Export path= $ZOOKEEPER _home/bin: $PATH
10: Let the file take effect
source. bash_profile
11: Switch to root, modify the firewall configuration file:
# chkconfig Iptables on
# service Iptables Start
Edit Vi/etc/sysconfig/iptables
Add the following 3 lines:
-A input-m state--state new-m tcp-p TCP--dport 2181-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 2888-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 3888-j ACCEPT
12: Restart the firewall:
Service Iptables Restart
13: View firewall Status:
Service Iptables Status
14: Switch user to/home/current logged in user (not root)/zookeeper-3.4.6/bin directory execution
# zkserver.sh Start
15: Enter JPS View process
46297 Quorumpeermain (Zookeeper process, start normal)
47555 Jps
16: If you want to boot zookeeper, edit the/etc/rc.local file, add the following information:
Su-wangfajun (My logged-on user)-C '/home/wangfajun/zookeeper-3.4.6/bin/zkserver.sh start '
Tip: Centos7 firewall is using FIREWALLD by default, starting with 11 steps and not using commands directly iptables
If you want to use your own iptables and ip6tables static firewall rules,
Then please install iptables-services and disable FIREWALLD, enable Iptables and Ip6tables:
Yum Install Iptables-services
Systemctl Mask Firewalld.service
Systemctl Enable Iptables.service
Systemctl Enable Ip6tables.service
The static firewall rule configuration file is/etc/sysconfig/iptables and/etc/sysconfig/ip6tables.
Note: The iptables and iptables-services packages do not provide firewall rules that are used in support of the service.
These services are designed to guarantee compatibility and use by people who want to use their own firewall rules.
You can install and use System-config-firewall to create the rules required for the above services.
In order to be able to use System-config-firewall, you must stop FIREWALLD.
After you create a rule for a service and deactivate FIREWALLD, you can enable iptables and Ip6tables services:
Systemctl Stop Firewalld.service
Systemctl Disable firewalld.service# disable firewall boot boot
Systemctl Start Iptables.service
Systemctl Start Ip6tables.service
Centos7 Installing Zookeeper (. tar.gz version)