The application of zookeeper in HBase

Source: Internet
Author: User
Tags stop script zookeeper

A distributed HBase system installation relies on a running zookeeper cluster, and all participating nodes and clients must have normal access to the running zookeeper cluster. HBase defaults to you to provide a node of the zookeeper cluster, which will accompany the HBase start/stop process start/stop and start/stop, of course you can also run your own zookeeper cluster, in order to switch whether to enable the default zookeeper cluster, You need to change the value of Hbase_manages_zk to False in conf/hbase-env.sh, which is ture by default.
When HBase manages the zookeeper cluster, you can conf/ The zookeeper properties are configured on Hbase-site.xml, and their prefixes are hbase.zookeeper.property, such as Hbase.zookeeper.property.clientPort configuration ClientPort properties. The complete Zookeeper cluster list references the Zookeeper Zoo.cfg file, and you should view the file when the zookeeper hangs.
When configuring HBase fully distributed system, you must list your machines with Hbase.zookeeper.quorum on the profile hbase-site.xml.
Here is an example of the HBase management zookeeper, note that you should configure the Hbase.zookeeper.property.dataDir property instead of using the default value, because the default value saves the data to the/tmp directory and is emptied when the system restarts.

  <configuration> ... <property> <name>hbase.zookeeper.property.clientPort</name>
      <value>2222</value> <description>property from ZooKeeper ' s config zoo.cfg.
      The port at which the clients would connect.
      </description> </property> <property> <name>hbase.zookeeper.quorum</name> <value>rs1.example.com,rs2.example.com,rs3.example.com,rs4.example.com,rs5.example.com</value> <
      Description>comma separated list of servers in the ZooKeeper Quorum.
      For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com". By default, this is the set to localhost for local and pseudo-distributed modes of operation. For a fully-distributed setup, the This should is set to a full list of ZooKeeper quorum servers.
      If Hbase_manages_zk is set in hbase-env.sh the list of servers which we'll start/stop ZooKeeper on. </description> </property> <property> <name>hbase.zookeeper.property.datadir</name&gt
      ;
      <value>/usr/local/zookeeper</value> <description>property from zookeeper ' s config zoo.cfg.
      The directory where the snapshot is stored. </description> </property> ... </configuration>
1 Using existing zookeeper systems

In order to make HBase point to an already existing zookeeper cluster, set the HBASE_MANAGES_ZK position in conf/hbase-env.sh false.

  ...
  # tell HBase whether it should manage their own instance of Zookeeper or not.
  Export Hbase_manages_zk=false

Management zookeeper can use HBase's start/stop script, as follows:

${hbase_home}/bin/hbase-daemons.sh {Start,stop} zookeeper

For more information on launching distributed zookeeper clusters, refer to getting Started guide. 2 ZooKeeper SASL certification

The new version of HBase (>0.92) supports SASL authentication when zookeeper is connected, zookeeper version requires 3.4.0 or more. Refer to Zookeeper SASL.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.