Client applications such as IDEs and utilities must trust the Metadata Service (MDS) if
it is configured to use a self-signed certificate. The software installations use self-signed
certificates as default setting.
About this task
The following procedure gives instructions to import a self-signed certificate into a
truststore for use by the client utilities.
Procedure
To import the certificate into your truststore, complete the following
steps:
-
On a client workstation from where you intend to connect to MDS, get the certificate served by
thrift server.
echo QUIT | openssl s_client -showcerts -connect <hive-metastore-host>:<nodeport> | awk '/-----BEGIN CERTIFICATE-----/ {p=1}; p; /-----END CERTIFICATE-----/ {p=0}' > hms.cert
- Use one of the following methods to add certificate to truststore:
- Add to your existing Java™ truststore.
keytool -import -trustcacerts -cacerts -storepass changeit -noprompt -alias hms-cert -file ./hms.cert
- Create a Java truststore.
keytool -import -alias hms-cert -file ./hms.cert -keystore ./hms-truststore.jks
- Check whether the certificate is imported correctly.
- If you added the certificate to existing Java
truststore, run the following command:
keytool -list -v -cacerts -storepass changeit -alias hms-cert
Note: changeit is the default password for the cacerts in
Java.
- If you created a new Java truststore, run the
following command:
keytool -list -v -keystore ./hms-truststore.jks -alias hms-cert