SQuirreL SQL remains a lightweight and reliable JDBC client for connecting to HiveServer2, especially in on-prem Kerberized clusters. While older Hadoop versions required assembling dozens of JAR dependencies manually, modern Hive distributions ship a shaded JDBC driver that simplifies configuration significantly.
Prerequisites for Kerberos Authentication
Before launching SQuirreL, ensure that you obtain a valid Kerberos ticket:
kinit your_user@YOUR.REALM
Most Hadoop distributions automatically pick up krb5.conf from system paths (/etc/krb5.conf on Linux, /Library/Preferences on macOS).
If you need to override these settings, create a small JAAS file such as:
KrbClient {
com.sun.security.auth.module.Krb5LoginModule required
useTicketCache=true
renewTGT=true;
};
Then launch SQuirreL with the JAAS and Kerberos system properties:
export JAVA_OPTS="-Djava.security.auth.login.config=jaas.conf \
-Djavax.security.auth.useSubjectCredsOnly=false"
Modern SQuirreL installations allow you to add JAVA_OPTS via the launcher rather than editing startup scripts.
Adding the Hive JDBC Driver
Use the current “shaded” Hive JDBC driver, which bundles most dependencies:
hive-jdbc-version-standalone.jar
This avoids the large dependency list required by older CDH 4.x and Hive 0.10 clients. Add the shaded JAR via:
- Open Drivers in SQuirreL.
- Click + to create a new driver.
- Enter a name, e.g., HiveServer2 Kerberos.
- Driver Class:
org.apache.hive.jdbc.HiveDriver - Extra Class Path → Add the shaded JAR.
Connection URL for Kerberos
Use the HiveServer2 Kerberos-enabled URL format:
jdbc:hive2://HOST:PORT/DB;principal=hive/HOST@YOUR.REALM
If you are not using Kerberos, remove the principal portion:
jdbc:hive2://HOST:PORT/DB
No additional JAAS settings are required in non-Kerberos mode.
Java Version Compatibility
Kerberos authentication can fail if the client JVM version mismatches the server’s expectations. If you encounter GSS errors, try matching the JDK major version used on the HiveServer2 host.
Historical Context
Early Hadoop deployments (circa 2014) required:
- modifying SQuirreL’s startup script
- manually inserting 15–20 JAR files from CDH or HDP
- hardcoding Kerberos system properties
Modern distributions ship shaded Hive JDBC drivers and rely on system-level Kerberos configuration, making the process far simpler and more reliable.
For reference, SQuirreL SQL is available at: http://squirrel-sql.sourceforge.net
If you need help with distributed systems, backend engineering, or data platforms, check my Services.