Complete the following tasks to configure Hive HA solution:
Use the following instructions to install HDP on your cluster hardware. Ensure that you specify the virtual machine (configured in the previous section) as your NameNode.
Download Apache Ambari using the instructions provided here.
Note Do not start the Ambari server until you have configured the relevant templates as outlined in the following steps.
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 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 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 HDP installation.
Continue the Ambari installation process using the instructions provided here.
Complete the Ambari installation. Ensure that the installation was successful.
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 | |
---|---|
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. |
Open a command prompt on the machine hosting the Hive metastore.
Execute the following command to retrieve a list of URIs for the filesystem roots, including the location of the NameService:
hive --service metatool -listFSRoot
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
Execute the command again, this time without the
-dryRun
option:hive --service metatool -updateLocation <nameservice-uri> <namenode-uri>