Get Databricks Hive metastore connection username and password

805 views Asked by At

I configured a Databricks cluster (Azure) and wonder how do we get access directly to the Hive metastore. This is what I did:

cat /databricks/hive/conf/hive-site.xml

<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>[REDACTED]</value>
  <description>Username to use against metastore database</description>
</property>
<property>

The value is always has [REDACTED] Is there a way to get clear text?

Sorry if this is a newbie question. I assume dbutils.secrets.get() can get the value if passing some specific params?

1

There are 1 answers

0
M.S. On

I actually managed to retrieve both username and password using your command via the web terminal.

To do so, you first have to go "Settings->Admin Console->Workspace Settings", and then under "Advanced" activate "Web Terminal".

Web Terminal option

After that (maybe you need to refresh your page), you can start your cluster, open a Notebook (or create an empty one), and you should be able to see "Terminal" in the options of the cluster selection box (top-left corner of the Notebook page):

enter image description here

Once you click "Terminal", it should open a web terminal, and if you execute your command there (cat /databricks/hive/conf/hive-site.xml) you will get username and password in clear form.

I tried executing the same command in a Python script using subprocess, and it was redacted, so something must act differently.