One: Zookeeper cluster mode configuration
"1" zookeeper/cnfg/zoo_sample.cfg
Copy a sample file and write the configuration in zoo.cfg. The same configuration file is placed in the directory for all nodes in the cluster
#dataDir =/var/zookeeper
The directory where the zookeeper snapshot files are stored, to create the zookeeper directory under the Liunx directory
#clientport =2181
Port number for external service of zookeeper server
#server. Id=host:port1:port2
ID of the node in the ID==>ZK cluster
IP address of the machine node in the HOST==>ZK cluster
Port1==>follower and leader communication ports
Port2==>leader the polling port of the cluster for the server election process
"2" creates myID file under all Machine node profile directory zookeeper/cnfg/in the cluster
---> myID file in this directory on a machine node
---> and writes the ID of the current machine node in the myID file (server. ID ID value)
"3" Start the server
--->cd/opt/zookeeper/bin/bin
--->./zkserver.sh start (start server)
--->./zkserver.sh Stop (server shutdown)
"4" Test is started successfully
--->telnet start the port number of the ZK machine node IP for external service (telnet 192.168.1.105 2181)
--->stat
II: Zookeeper pseudo-cluster mode configuration
"1" pseudo-cluster mode (a zookeeper machine forged into a cluster) configuration and cluster mode configuration is similar, there are differences on the configuration file.
#server. Id=host:port1:port2
---the same IP address as the >host
--->follower and leader communicate the same port number.
--->leader election is not the same number
"2" File snapshot storage and myID configuration unchanged
Three: Zookeeper single machine mode configuration
The configuration of "1" stand-alone mode (one zookeeper machine) is different on the configuration file.
#server. Id=host:port1:port2
---> Profiles keep only one of the records.
"2" File snapshot storage and myID configuration unchanged
Four: Zookeeper cluster, pseudo-cluster, stand-alone construction