Hadoop High Availability
Also available as:
PDF

Update the Hive Metastore

HDP components configured for HA must use a NameService rather than a NameNode. Use the following instructions to update the Hive Metastore to reference the NameService rather than a Name Node.

[Note]Note

Hadoop administrators also often use the following procedure to update the Hive metastore with the new URI for a node in a Hadoop cluster. For example, administrators sometimes rename an existing node as their cluster grows.

  1. Open a command prompt on the machine hosting the Hive metastore.

  2. Set the HIVE_CONF_DIR environment variable:

    export HIVE_CONF_DIR=/etc/hive/conf.server
  3. Execute the following command to retrieve a list of URIs for the filesystem roots, including the location of the NameService:

    hive --service metatool -listFSRoot
  4. Execute the following command with the -dryRun option to test your configuration change before implementing it:

    hive --service metatool -updateLocation <nameservice-uri> <namenode-uri> - dryRun
  5. Execute the command again, this time without the -dryRun option:

    hive --service metatool -updateLocation <nameservice-uri> <namenode-uri>