Linux zookeeper installation tutorial, linuxzookeeper tutorial
First install jdk
Then download
Because zookeeper is elected in half, an odd number of nodes are usually installed. The machine list is as follows:
192.168.33.11
192.168.33.12
192.168.33.13
1. Decompress tar-zxvf zookeeper-3.4.5.tar.gz
Mvzookeeper-3.4.5 ../zookeeper
2. modify configuration
Cp/zookeeper/conf/zoo_sample.cfg zoo. cfg
Vi zoo. cfg
Modify:
TickTime = 2000
InitLimit = 10
SyncLimit = 5
DataDir =/usr/local/zookeeper/data
DataLogDir =/usr/local/zookeeper/logs
ClientPort = 2181
Server.1 = 192.168.33.11: 2881: 3881
Server.2 = 192.168.33.12: 2882: 3882
Server.3 = 192.168.33.13: 2883: 3883
Open the Firewall:
Vi/etc/sysconfig/iptables
# Zookeeper
-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 2881-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 3881-j ACCEPT
Service iptables restart
The vi/usr/local/zookeeper/data/myid value is 1.
Start./bin/zkServer. sh start
Disable./bin/zkServer. sh stop
Jps
1456 QuorumPeerMain
QuorumPeerMain is the zookeeper process, which indicates that the process is started normally.