Beeline commands – Hadoop – Kerberos and LDAP

By | September 3, 2014
Few Beeline examples
For Kerberos Users:
Ex: Lets say below is our server details:
Hive server2:
Kerberos user: puneetha
Database name: default

We can connect to hive server2 in beeline as below:

beeline> !connect jdbc:hive2://;principal=hive/host1@PUNEETHA.COM 
Connecting to jdbc:hive2://host1:10000/default;principal=hive/host1@PUNEETHA.COM
Enter username for jdbc:hive2://host1:10000/default;principal=hive/host1@PUNEETHA.COM: puneetha
Enter password for jdbc:hive2://host1:10000/default;principal=hive/host1@PUNEETHA.COM: ***********

For LDAP Users
Ex: Lets say below is our server details:
Hive server2:
user: dummyuser
Database name: default

beeline> !connect jdbc:hive2://<server-ip>:10000/default
Connecting to jdbc:hive2://
Enter username for jdbc:hive2:// dummyuser
Enter password for jdbc:hive2:// ***********

One shot command looks like this:

$beeline -u jdbc:hive2://<server-ip>:10000/databaseName  -n <your-id> -p <your-password> --outputformat=csv -f input_query.sql > query_results.out

Few parameters:

Comment below if you find this blog useful.

Leave a Reply

Your email address will not be published. Required fields are marked *