IBM Cloud Docs
Retrieving Hive metastore(HMS) credentials

Retrieving Hive metastore(HMS) credentials

IBM® watsonx.data integrates with multiple entities like Spark, Db2, NPSaaS, and the like. You require watsonx.data HMS credentials to establish connection with the entities at the time of integration.

You must generate the following HMS credentials.

  • HMS endpoint (thrift url). Follow the steps to generate the thrift url.
  • HMS username is by default ibmlhapikey
  • Certificate verification. Follow the steps to verify the certificate.
  • API key. Follow the steps to generate the key.

Prerequisites

IBM® watsonx.data uses the 4.0.0-alpha-2 version of HMS and you must have the support thrift protocol jar to ensure compatibility.

Getting the HMS endpoint

  1. Log in to watsonx.data console.
  2. From the navigation menu, select Infrastructure manager.
  3. Select the catalog.
  4. Click Details to view the catalog details page.
  5. Copy the Metastore host. This is your HMS endpoint (thrift url).

Loading certificates to Java truststore

To establish connection with watsonx.data, you (the integrating entities) must mount the well-known certificate along with your implementation code. You can either use the trust certificate that you have or use the java certificate. Choose the well-known certificate based on your implementation code language. For example, if your code is in Java, get the corresponding well-known certificate.

To load the well-known certificate to the truststore, update your implementation code to include the well-known certificate.

  1. To use your certificate, update the truststorepath variable. Specify the path of your certificate in the truststorePath field. In the below example, a jvm certificate is mounted. You can mount your own well known trust certificate.
String truststorePath =
System.getProperty("java.home") + File.separator +"lib"+ File.separator + "security" + File.separator + "cacerts";

MetastoreConf.setVar(clientConf, ConfVars.SSL_TRUSTSTORE_PATH, truststorePath);

You can now successfully establish connection with watsonx.data.

Generating API key

  1. In the IBM Cloud console, go to Manage and create service ID. For information about creating service ID, see Creating a service ID.
  2. In the Access tab, from Access policies, click Assign access. The Assign access to Doc Service page opens.
  3. Select Access policy. In the Create policy section, select the UI tab.
  4. Search and select watsonx.data from the Service field.
  5. Click Next. The Access policies section is reflected with the role.
  6. Go to Manage > Access (IAM), and select the Service IDs.
  7. Identify the row of the service ID for which you want to select an API key. Select the name of the service ID.
  8. Click API keys.
  9. Click Create.
  10. Specify a name and description to easily identify the API key.
  11. Click Create.
  12. Save your API key by copying or downloading it to secure location.