1. install ZooKeeper and metaQ2. download ghost
1. requirements
Install ZooKeeper and metaQ
2. Download
Http://zookeeper.apache.org/releases.html
The current stable version is a zookeeper-3.4.6
3. extract
Tar-xf zookeeper-3.4.6.tar.gz
Decompress the file to "/usr/local/zookeeper-3.4.6 ".
4. copy zoo_sample.cfg under the conf directory and name it zoo. cfg.
5. modify the zoo. cfg configuration file
# The number of milliseconds of each tick
TickTime = 2000
# The number of ticks that the initial
# Synchronization phase can take
InitLimit = 10
# The number of ticks that can pass
# Sending a request and getting an acknowledgement
SyncLimit = 5
# The directory where the snapshot is stored.
# Do not use/tmp for storage,/tmp here is just
# Example sakes.
DataDir =/datatmp/zookeeper/data
DataLogDir =/datatmp/zookeeper/logs
# The port at which the clients will connect
ClientPort = 2181
# The maximum number of client connections.
# Increase this if you need to handle more clients
# MaxClientCnxns = 60
#
# Be sure to read the maintenance section of
# Administrator guide before turning on autopurge.
#
# Http://zookeeper.apache.org/doc/current/zookeeperAdmin.html# SC _maintenance
#
# The number of snapshots to retain in dataDir
# Autopurge. snapRetainCount = 3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
# Autopurge. purgeInterval = 1
#2888,3888 are election port
Server.1 = zookeeper: 2888: 38888
Among them, Port 2888 is the port for communication between services, while Port 3888 is; port for zookeeper to communicate with other applications. zookeeper is the IP address mapped to the local machine in hosts.
InitLimit: this configuration item is used to configure Zookeeper to accept the client (the client mentioned here is not the client that the user connects to the Zookeeper server, but the Follower server connected to the Leader in the Zookeeper server cluster) the maximum heartbeat interval that can be tolerated during connection initialization. When the length of the heartbeat exceeds 10 (tickTime), the Zookeeper server does not receive the response from the client, which indicates that the connection to the client fails. The total length is 5*2000 = 10 seconds.
SyncLimit: this configuration item identifies the length of time for sending a message, request, and response between the Leader and Follower. The maximum length is 2*2000 = 4 seconds.
Server. A = B: C: D: where A is A number, indicating the number of the server. B is the ip address of the server; C indicates the port on which the server exchanges information with the Leader server in the cluster. D indicates that if the Leader server in the cluster fails, a port is required for re-election, select a new Leader, which is the port used for communication between servers during the election. For the pseudo cluster configuration method, because B is the same, different Zookeeper instance communication port numbers cannot be the same, so you need to assign them different port numbers.
6. create the directory specified by the dataDir parameter ("/datatmp/zookeeper/data" here) and create a file under the Directory named "myid ".
7. edit the "myid" file and enter the corresponding number on the machine of the corresponding IP address. For example, on zookeeper, the content of the "myid" file is 1. This time, only one server 1 is installed and configured on the single point of failure (SPOF. If there are other servers such as 192.168.1.102, add server.2 = 192.168.1.102: 2888: 3888 to the zoo. cfg file. The content of the myid file on the 192.168.1.102 server is 2. At this point, for a multi-server configuration, you need to copy the zookeeper-3.4.3 directory to another server and then modify the myid as described above.
8. set PATH in the/etc/profile file
Modify the profile file:
Sudo vi/etc/profile
export ZOOKEEPER_HOME=/home/hadooptest/zookeeper-3.4.3export PATH=$ZOOKEEPER_HOME/bin:$PATHexport PATH
Oh yeah !!! Installation complete!
After installation, start the installation.
1. start
zookeeper-3.4.6/bin/zkServer.sh start
2. enter the jps command to view the process
1573 QuorumPeerMain1654 Jps
Among them, QuorumPeerMain is the zookeeper process and starts normally.
3. View status: zookeeper-3.4.3/bin/zkServer. sh status
-JMX enabled by defaultUsing config: /usr/local/zookeeper-3.4.6/bin/../conf/zoo.cfgMode: standalone
4. start the client script: zookeeper-3.4.3/bin/zkCli. sh-server zookeeper: 2181
5. stop the zookeeper process: zookeeper-3.4.3/bin/zkServer. sh stop
Participation:
Http://zookeeper.apache.org/doc/trunk/zookeeperStarted.html