Four: Zookeeper cluster, pseudo-cluster, stand-alone construction

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.