Using JDBC or Beeline to Connect to HiveServer2
The method that HiveServer2 clients use to connect to HiveServer2 is based on the HiveServer2 Authentication method and the type of client.
Using ODBC to Connect to HiveServer2
For details on how to install and use ODBC to connect to Hive, see Hive ODBC Connector.
Using JDBC or Beeline to Connect to HiveServer2
HiveServer2 Authentication | Connection Requirements |
---|---|
No Authentication |
Connection String: jdbc:hive2://<hostname>:10000/default For encryption, JDBC requires a truststore and an optional truststore password.
|
MapR-SASL |
Connection String: jdbc:hive2://<hostname>:10000/default;auth=maprsasl Connection String with Encryption (Hive 0.13 version):jdbc:hive2://<hostname>:10000/default;auth=maprsasl;sasl.qop=auth-conf Connection String with Encryption (Hive 1.0 version):jdbc:hive2://<hostname>:10000/default;auth=maprsasl;saslQop=auth-conf
Connection for Java Application:Use the -D flag to append the JVM
argument: |
PAM |
Connection String: jdbc:hive2://hs2node:10000/default;user=<userid>;password=<password> |
Kerberos |
Connection String:jdbc:hive2://<hostname>:10000/default;principal=mapr/<FQDN@REALM> Connection String with Encryption (Hive 0.13 version):jdbc:hive2://<hostname>:10000/default;principal=mapr/<FQDN@REALM>;sasl.qop=auth-conf Connection String with Encryption (Hive 1.0 version): jdbc:hive2://<hostname>:10000/default;principal=mapr/<FQDN@REALM>;saslQop=auth-conf
Connection for Java Application:Use the -D flag to append the JVM
argument: NOTE: The client nodes must also have a Kerberos ticket and be configured to
connect to HiveServer2 to using Kerberos.
|
LDAP | Connection String: jdbc:hive2://hs2node:10000/default;user=<userid>;password=<password> |