How to deploy zookeeper Cluster
This article is about how to deploy zookeeper clusters. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it with the editor.
Zookeeper
Provide coordination services for distributed programs. As a third party to manage some shared data, zookeeper itself is very reliable and provides services in a distributed cluster (immortal).
The main functions of zookeeper:
1. Keep the data submitted by the client (a very small amount of data): each piece of data forms a tree structure between zookeeper called a znode,znode.
Zookeeper cluster installation:
1. Decompression
2. Conf modifies vim zoo.cfg
TickTime=2000 initLimit=10 syncLimit=5 dataDir=/data/solrcloud/zookeeper/data clientPort=2181 server.1=x01:2888:3888 server.2=x02:2888:3888 server.3=x03:2888:3888
3. Create / data/solrcloud/zookeeper/data directory
Mkdir / data/solrcloud/zookeeper/data
4. Create a file myid file with the number of server
Echo 1 > myid
4. Copy zookeeper to the other two machines (x02 and x03)
On the respective machines, modify the contents of myid, such as x02 to echo 2 > myid
5. Start
Start the zookeeper on the three machines
. / zkServer.sh start
6. Check whether the zookeeper of the three machines is a cluster.
. / zkServer.sh status/** result JMX enabled by defaultUsing config: / data/solrcloud/zookeeper/bin/../conf/zoo.cfgMode: leader * / / indicates that this zookeeper is the role of leader
7. Connect to the server for testing
. / zkCli.sh / / connect native / / create a file [zk: localhost:2181 (CONNECTED) 2] create / zooktest 80Created / zooktest// View directory [zk: localhost:2181 (CONNECTED) 3] ls / [zooktest] / / View the contents of the file [zk: localhost:2181 (CONNECTED) 4] get / zooktest80cZxid = 0x220000086actime = Fri Sep 02 17:12:40 CST 2016mZxid = 0x220000086amtime = Fri Sep 02 17:12:40 CST 2016pZxid = 0x220000086acversion = 0dataVersion = 0ephemeralOwner = 0x0dataLength = 2numChildren = 0pm / Modify the contents of the file [zk: localhost:2181 (CONNECTED) 5] set / zooktest90 [zk: localhost:2181 (CONNECTED) 6] get / zooktest90cZxid = 0x220000086actime = Fri Sep 02 17:12:40 CST 2016mZxid = 0x220000086bmtime = Fri Sep 02 17:18:09 CST 2016pZxid = 0x220000086acversion = 0dataVersion = 1aclVersion = 0x0dataLength = 2numChildren = 0 is how to deploy zookeeper clusters The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.