Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 03-08-2016 04:10 PM
I want to create new user for hive. When I installed hive using Ambari I created default hive user but want to create one more user. I know it has to be through HDFS but can some one give me exact commands to run and where should I create that. All hive documentation doesn't give me that option.
Created 03-08-2016 05:02 PM
By itself any HDFS user can use Hive.
If you do not have kerberos:
1) Just add the user to Linux with useradd ( or add to your ldap )
2) create user home directory
as user hdfs do
hadoop fs -mkdir /home/myuser
hadoop fs-chown myuser /home/myuser
And that's it you should now be able to run queries as that user.
Now there is a second part for secure clusters
If you have kerberos:
1) Add user to your KDC
2) kinit as the user
3) run hive
Using hiveserver2 with beeline or jdbc driver:
Depends on which security you have configured for hiveserver2
- None, just specify myuser as user ( -n myuser )
- PAM uses Linux so give -n myuser -p myuserlinuxpassword
- LDAP uses an LDAP server lets assume its the same as your linux user
- kerberos needs a kinit and specify the principal in the jdbc url
Finally your user needs access to the tables:
No authorization
- make sure the tables you want to read are readable by that user or enable doAs=false
Ranger
- Add access to the table in Ranger portal
SQLStdAuth
- Grant access to the table using GRANT command
Created 03-08-2016 05:02 PM
By itself any HDFS user can use Hive.
If you do not have kerberos:
1) Just add the user to Linux with useradd ( or add to your ldap )
2) create user home directory
as user hdfs do
hadoop fs -mkdir /home/myuser
hadoop fs-chown myuser /home/myuser
And that's it you should now be able to run queries as that user.
Now there is a second part for secure clusters
If you have kerberos:
1) Add user to your KDC
2) kinit as the user
3) run hive
Using hiveserver2 with beeline or jdbc driver:
Depends on which security you have configured for hiveserver2
- None, just specify myuser as user ( -n myuser )
- PAM uses Linux so give -n myuser -p myuserlinuxpassword
- LDAP uses an LDAP server lets assume its the same as your linux user
- kerberos needs a kinit and specify the principal in the jdbc url
Finally your user needs access to the tables:
No authorization
- make sure the tables you want to read are readable by that user or enable doAs=false
Ranger
- Add access to the table in Ranger portal
SQLStdAuth
- Grant access to the table using GRANT command
Created 03-12-2018 07:49 PM
if I use SQL Authentication using this method, how should I assign passwords to users? For using in DB connection for instance...
Will Hive consider OS level user passwords? If so, should I set a password also for 'hive' user? Does it affect other operations?
Created 08-07-2018 11:07 PM
@bleonhardi, How can I connect to Hive with a UNIX/HDFS user?
Let's say I have a user named "newuser". I tried the following, but apparently I am doing something wrong.
% su - newuser % beeline beeline> !connect -n newuser -p jdbc:mysql://my.host.com/hive