Chapter III deploy big data environment to build stand-alone mode --Zookeeper
First, the preparatory phase
- 1, enter the official website to find the download address, copy the download link to
download the official website address: https: //zookeeper.apache.org/releases.html
- 2, after the virtual machine is connected via Xshell, enter ~ / opt directory using
weget xxxxxxxxxxxxxxx / content xxxx-zookeeper.tar.gz download link the address to the
download link command you just copy the link address that is in the site
Second, the installation zookeepr
-
1, zookeeper decompression
using the command tar -zxvf apache-zookeeper-bin- xxxtar.gz -C ~ / opt just downloaded good
zookeeper archive into the archive directory opt
to create a soft connection file unpacked
-
2, the configuration zookeeper
vim ~ / .bashrc zookeeper edit the file to add environment variables
source ~ / .bashrc source refresh the environment variables you just configured into force
cd ~ / opt / zookeeper / conf configuration directory into the zookeeper's
because in just unzip the file zookeeper yes yes no zoo.cfg so we need to copy the file from the sample configuration file that provides an out of the
cp zoo_sample.cfg zoo.cfg
vim editor zoo.cfg we just copy out of the configuration file
Configuration Item | Defaults | Explanation |
---|---|---|
ticking time | 2000ms | zookeeper unit of time, all the time zookeeper to the most time reference unit, configured multiplied by an integer |
initLimit | 10 | Follwer during startup, will synchronize all the latest data from the Leader, they can determine the initial state of external services, has not been completed when the Follower data initLimit a tickTime synchronization, the Leader is still Follower link failure |
sysncLimit | 5 | Communication request and response time length between Leader and Follower. If the Leader in syncLimit tickTime have not received a reply Follower, Leader is considered offline. |
dataDir | /tmp/zookeeper | Snapshot file storage directory, by default, the transaction log is stored in the directory, because the transaction log write performance directly affects the performance of ZooKeeper, it is recommended that while the configuration parameters dataLogDir |
dataLogDir | /tmp/zookeeper | Transaction log output directory |
clientPort | 2181 | ZooKeeper external port |
Third, start with test Zookeeper
- 1, start ZooKeeper (in advance because we configured the environment variables in here so you can use command to start in any direct path)
zkServer.sh start
- 2, view the status ZooKeeper
zkServer.sh status
At this point, ZooKeeper stand-alone configuration has been completed, such as problems in the configuration process, you are welcome to comment in the comment section below! !