Chapter III deploy big data environment to build stand-alone mode --Zookeeper

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.htmlHere Insert Picture Description
    Here Insert Picture Description
    Here Insert Picture Description
    Here Insert Picture Description
  • 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
    Here Insert Picture Description

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
    Here Insert Picture Description
    to create a soft connection file unpacked
    Here Insert Picture Description

  • 2, the configuration zookeeper
    vim ~ / .bashrc zookeeper edit the file to add environment variables
    Here Insert Picture Description
    Here Insert Picture Description
    source ~ / .bashrc source refresh the environment variables you just configured into force
    Here Insert Picture Description
    cd ~ / opt / zookeeper / conf configuration directory into the zookeeper's
    Here Insert Picture Description
    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
    Here Insert Picture Description
    vim editor zoo.cfg we just copy out of the configuration file
    Here Insert Picture Description

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

Here Insert Picture Description

  • 2, view the status ZooKeeper
zkServer.sh status

Here Insert Picture Description
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! !

Published 27 original articles · won praise 62 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_42359956/article/details/102836106