I would like to connect to a hive service running on BigInsights from a spark notebook using jdbc. The jdbc url format is:
jdbc:hive2://${env.hostname}:10000/default;ssl=true;sslTrustStore=./truststore.jks;trustStorePassword=mypassword;
As you can see from the url, this connection requires a truststore. How should I make the truststore available to spark as a service?
Update 1:
- The certificate is not issued by a well known CA.
- Tenants have no access to the JRE/JDK on the service.
Update 2:
I can add the certificate and truststore using the following:
with open('certificate', 'w') as f:
f.write('''
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
''')
!keytool -import -trustcacerts -alias biginsights -file certificate -keystore truststore.jks -storepass mypassword -noprompt
The final part of the question now is how to add a jar to python notebook on bluemix spark?