Configuring Apache Hive Metastore High Availability in CDH

You can enable Hive metastore high availability (HA) so that your cluster is resilient to failures if a metastore becomes unavailable. When HA mode is enabled, one of the metastores is designated as the master and the others are slaves. If a master metastore fails, one of the slave metastores takes over.

Prerequisites

  • Cloudera recommends that each instance of the metastore runs on a separate cluster host, to maximize high availability.
  • Hive metastore HA requires a database that is also highly available, such as MySQL with replication in active-active mode. Refer to the documentation for your database of choice to configure it correctly.

Enabling Hive Metastore High Availability Using Cloudera Manager

Minimum Required Role: Configurator (also provided by Cluster Administrator, Full Administrator)

  1. Go to the Hive service.
  2. If you have a secure cluster, enable the Hive token store. Non-secure clusters can skip this step.

    To apply this configuration property to other role groups as needed, edit the value for the appropriate role group. See Modifying Configuration Properties Using Cloudera Manager.

    1. Click the Configuration tab.
    2. Select Scope > Hive Metastore Server.
    3. Select Category > Advanced.
    4. Locate the Hive Metastore Delegation Token Store property or search for it by typing its name In the Search box.
    5. Select org.apache.hadoop.hive.thrift.DBTokenStore.
    6. Click Save Changes to commit the changes.
  3. Click the Instances tab.
  4. Click Add Role Instances.
  5. Click the text field under Hive Metastore Server.
  6. Check the box by the host on which to run the additional metastore and click OK.
  7. Click Continue and click Finish.
  8. Check the box by the new Hive Metastore Server role.
  9. Select Actions for Selected > Start, and click Start to confirm.
  10. Click Close and click to display the stale configurations page.
  11. Click Restart Stale Services and click Restart Now.
  12. Click Finish after the cluster finishes restarting.