"Hbase" modifies the Hbase compression mode and restarts a regionserver

Source: Internet
Author: User


One: HBase compression mainly divides into three kinds

1 hfile block compression on disk: This type of compression is mainly used for compression stored on the hard disk. Supports gzip, Lzo, snappy three kinds of data compression. The following two types require additional configuration and installation dependencies. HBase the first compression method is provided by default. Gzip compared with lzo compression is higher, and Lzo is higher performance.

To configure compression in Hbase-site.xml:

<property>
  <name>io.compression.codecs</name>
  <value></value>
  < Description>a List of the compression codec classes that can is used for 
               Compression/decompression.</descriptio N>
</property>


In addition, if the data compression method is configured incorrectly, it may cause the regionserver to fail to start, and restart the habse after modifying the configuration.

Verify that the data compression settings are appropriate you can use the following command to test whether the machine supports some type of compression:

./hbase Org.apache.hadoop.hbase.util.CompressionTest


For snappy and Lzo installation please see: Snappy and Lzo installation and setup

2) In-cache key compression:

This is the compression in the hfile, in hfile some key-value in the key may be similar or the same, you should use compression. Only the key is compressed and the value is not manipulated. There may be many ways to compress. For example, according to the first letter compression, diff compression

3) A Custom dictionary-based write-ahead log compression:

This is the compression in the Wal. Wal is the write ahead Log,hbase storage is the way to write the log in advance.


Two: Restart a regionserver

bin/graceful_stop.sh--restart--reload--debugnodename

This operation is a smooth restart of the regionserver process, will not affect the service, he will first need to restart the regionserver above all the region to other servers, and then restart, and finally will be the previous region migrated back, but we modify a configuration , you can reboot each machine in this way, this command will turn off the balancer, so in the end we're going to perform a balance_switch true in the HBase shell, and for HBase Regionserver reboot, don't kill the process directly, This can cause a long interruption in zookeeper.session.timeout, and do not go through bin/hbase-daemon.sh stop regionserver to reboot, if the luck is not very good,- root-or. META. Table above, all requests will fail.

Shut down a regionserver

bin/graceful_stop.sh--stop nodename

     as above, the system migrates all region before shutting down, and then the stop process, as well as finally we have to manually balance_switch true to turn on master's region balance.

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.