- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Beeline TLS connection string with username and password
- Labels:
-
Apache Hive
-
Security
Created on 06-11-2019 10:41 AM - edited 09-16-2022 07:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I’m newer to Hive so I’m assuming that I’m doing something wrong. I’ve configured Hive to require LDAP BasedDN authentication (not AD) and configured TLS for HiveServer2.
With beeline I’m able to authenticate with an interactive user prompt. For example:
beeline> !connect jdbc:hive2://<serverName>:10000/default;ssl=true;sslTrustStore=<trustStorePath>.jks;trustStorePassword=<trustStorePassword>
Login with username and password:
Enter username for jdbc:hive2://… Enter password for jdbc:hive2://…
What I would like to do is connect with username/password in the connection string. I see example to configure the connection string with TLS or username/password, but haven’t been able find an example of both. I’ve attempted combining settings and I’m doing something wrong.
This is an example of what I've attempted:
beeline -u jdbc:hive2://<serverName>:10000/default;ssl=true;sslTrustStore=<truststorePath>.jks;trustStorePassword=<trustStorePassword> -n User -w /home/User/passwordFile.txt
or
beeline -u jdbc:hive2://<serverName>:10000/default;ssl=true;sslTrustStore=<truststorePath>.jks;trustStorePassword=<trustStorePassword> -n User -p userPassword
Thanks for the help,
Created 06-12-2019 10:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried below format:
jdbc:hive2://hs2node:10000/default;user=<userid>;password=<password>
together with other parameters?
Thanks
Eric
Created 06-12-2019 10:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried below format:
jdbc:hive2://hs2node:10000/default;user=<userid>;password=<password>
together with other parameters?
Thanks
Eric
Created 06-13-2019 08:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Eric,
Thanks for the suggestion, but it didn't work. Below is output from trying and it shows that I'm able to login when prompted.
[user@serverHostName ~]$ beeline -u jdbc:hive2://serverFQDN:10000/demo;ssl=true;sslTrustStore=/opt/jdk/hive.truststore.jks;trustStorePassword=trustPassword;user=testUser;password=testUserPassword scan complete in 2ms Connecting to jdbc:hive2://serverFQDN:10000/demo Unknown HS2 problem when communicating with Thrift server. Error: Could not open client transport with JDBC Uri: jdbc:hive2://serverFQDN:10000/demo: Invalid status 21 (state=08S01,code=0) Beeline version 1.1.0-cdh5.14.4 by Apache Hive beeline> !connect jdbc:hive2://serverFQDN:10000/demo;ssl=true;sslTrustStore=/opt/jdk/hive.truststore.jks;trustStorePassword=trustPassword Connecting to jdbc:hive2://serverFQDN:10000/demo;ssl=true;sslTrustStore=/opt/jdk/hive.truststore.jks;trustStorePassword=trustPassword Enter username for jdbc:hive2://serverFQDN:10000/demo;ssl=true;sslTrustStore=/opt/jdk/hive.truststore.jks;trustStorePassword=trustPassword: test_user Enter password for jdbc:hive2://serverFQDN:10000/demo;ssl=true;sslTrustStore=/opt/jdk/hive.truststore.jks;trustStorePassword=trustPassword: **************** Connected to: Apache Hive (version 1.1.0-cdh5.14.4) Driver: Hive JDBC (version 1.1.0-cdh5.14.4) Transaction isolation: TRANSACTION_REPEATABLE_READ 0: jdbc:hive2://serverFQDN:10000/demo> show databases; INFO : Compiling command(queryId=hive_20190613081212_d18016a9-24a0-48b4-9023-783382566773): show databases INFO : Semantic Analysis Completed INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null) INFO : Completed compiling command(queryId=hive_20190613081212_d18016a9-24a0-48b4-9023-783382566773); Time taken: 0.669 seconds INFO : Concurrency mode is disabled, not creating a lock manager INFO : Executing command(queryId=hive_20190613081212_d18016a9-24a0-48b4-9023-783382566773): show databases INFO : Starting task [Stage-0:DDL] in serial mode INFO : Completed executing command(queryId=hive_20190613081212_d18016a9-24a0-48b4-9023-783382566773); Time taken: 0.299 seconds INFO : OK +----------------+--+ | database_name | +----------------+--+ | default | | demo | +----------------+--+ 2 rows selected (1.419 seconds) 0: jdbc:hive2://serverFQDN:10000/demo>
Created 06-13-2019 09:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Eric,
The user= and password= parameters worked once I put the connection string in single quotes ' '.
This is an example of what worked.
[user@serverHostName ~]$ beeline -u 'jdbc:hive2://serverFQDN:10000/demo;ssl=true;sslTrustStore=/opt/jdk/hive.truststore.jks;trustStorePassword=trustPassword;user=testUser;password=testUserPassword'
Double qoutes should work too.
Thanks for the help!
