If Hive is configured with ZooKeeper service discovery:
The server address is defined in the Hive configuration file located on the server at $HIVE_HOME/conf/hive-site.xml .
String url = "jdbc:hive2://hive-secure.myco.com:10000/secure_db;" + "principal=hive/hive-secure.myco.com@MYCO.REALM;" + "ssl=true;" + "sslTrustStore=/path/to/truststore.jks;" + "trustStorePassword=changeit"; hive server address java
Check hive --version on server and match client JAR.
jdbc:hive2://host:10001/default;transportMode=http;httpPath=cliservice If Hive is configured with ZooKeeper service discovery:
| Error | Likely cause | Fix | |------------------------------------|---------------------------------------|--------------------------------------| | Could not open client transport | Wrong port / HS2 not running | Check with netstat -tulnp \| grep 10000 | | SASL negotiation failure | Missing auth=noSasl or Kerberos | Use correct auth parameter | | No appropriate protocol | Hive version mismatch (TLS) | Match hive-jdbc version with server | | Peer indicated failure: Unsupported mechanism type PLAIN | Server expects Kerberos/LDAP | Use auth=noSasl only if server allows |
HS2 supports multiple clients, including JDBC (Java). import java
import java.sql.*;