Cluster is really good fun, the recent time every day to engage in clustering, Redis cache service cluster, SOLR Search service cluster,,, Balabala
Today talk about zookeeper, before building a Redis cluster, with 6 machines, some friends of the computer running up, a bit of cards, that here is mainly said pseudo-distributed cluster, the official version of the cluster needs 3 machines, I will be around the area and say, build up is very simple
First, say zookeeper.
What is zookeeper, as the name implies, zoo Administrator, what Hadoop elephant, hive bee, pig pig, are used this goods to tube, is big data hadoop inside ~
(digression: Know Euphytica, that is to say crosstalk straight man that, Yu Yunpeng's partner, ha haha, backyard, joking)
Main usage
1. Cluster Management
Provides master-slave management, load balancing, and high Availability (HA) management;
The agent level of the cluster, as the entrance (Redis cluster construction is not required ZK, there is no entrance to this argument, REDIS-CLI casually access the IP on the line)
Zookeeper must be a cluster in order to guarantee a highly available zookeeper there are voting and voting mechanisms. There should be at least three nodes in a cluster. Why is 3 nodes, if there is a machine down, the mechanism is to select more than half, if it is two, then not, so at least 3 units
2, centralized management of files, unified configuration
For a chestnut: When the SOLR cluster is set up, the SOLR configuration file needs to be uploaded to Zk to allow ZK to be unified and managed, each node to the ZK to take the configuration file (the next article will be the SOLR cluster build)
3, Distributed Lock (Hadoop processing Big Data need to use, the general cluster does not need to use, will not elaborate)
Servers required by the cluster
Zookeeper:3 Station (pseudo-distributed 1 units can be)
For example, the first one as pseudo-distributed, the following 3 units as a formal cluster
Cluster Setup steps:
1, install the JDK, this must be installed, ZK is Hadoop, are based on the JDK, with JDK7
2, zookeeper installation package upload to the server
Extract
Create a folder
Copy the decompression to this folder
(Only one copy in the cluster is OK)
Create a data file and create myID, write 1 (zk02 corresponds to "2", zk03 corresponds to "3")
(This is also true in clusters)
Enter the Conf file, copy the zoo_sample.cfg and rename the file to Zoo.cfg
Modify the Zoo.cfg to specify the Datadir= property as the Data folder you just created
Modify the port (pseudo-distributed due to the same IP, must be changed, not required by the cluster)
The configuration is ready to start.
Zookeeper has a bin,zkserver.sh start zookeeper
This is pseudo-distributed under the 3 nodes, one of the main, 2 from
The same in the cluster, 1 master, 2 from, OK, configuration is complete, tomorrow we talk about the building of SOLR cluster, a good game of search service Oh ~
(Public number: Wxleechenxiang)
Zookeeper one or two-build zookeeper pseudo-distributed and formal clusters to provide cluster services