2. Software Configuration

Complete the following tasks to configure a Hive HA solution:

 2.1. Install HDP

Use the following instructions to install HDP on your cluster hardware. Ensure that you specify the virtual machine that you configured in the section, "Use Cases and Failover Scenarios" as your NameNode.

  1. Download the Apache Ambari repository using the instructions provided in "Ambari Repositories" section of the Ambari 1.7.0 Documentation Suite.

    [Note]Note

    Do not start the Ambari server until you have configured the relevant templates as outlined in the following steps.

  2. Edit the <master-install-machine-for-Hive-Metastore>/etc/hive/conf.server/hive-site.xml configuration file to add the following properties:

    • Provide the URI for the client to contact the metastore server. The following property can have a comma separated list when your cluster has multiple Hive metastore servers.

      <property>
           <name>hive.metastore.uris </name>
           <value>thrift://$Hive_Metastore_Server_Host_Machine_FQDN</value>
           <description>URI for client to contact metastore server</description>
      </property>
    • Configure the Hive cluster delegation token storage class.

      <property>
           <name>hive.cluster.delegation.token.store.class</name>
           <value>org.apache.hadoop.hive.thrift.DBTokenStore</value>
      </property>
    • Complete the HDP installation.

      • Continue the Ambari installation process using the instructions provided in "Install, Configure and Deploy an HDP Cluster" section of the Ambari 1.7.0 Documentation Suite.

      • Complete the Ambari installation. Ensure that the installation is successful.

 2.2. 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 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>

 2.3. Validate Configuration

Test various failover scenarios to validate your configuration.