Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use hive with other user

Tags:

hive

I installed Hadoop and Hive on 3 cluster. Normally I can use hive and Hadoop but when i log in with other user, I can't use Hive. The error is:

hive> show tables;

FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Cannot get a connection, pool error Could not create a validated object, cause: A read-only user or a user in a read-only database is not permitted to disable read-only mode on a connection.

NestedThrowables:

org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Could not create a validated object, cause: A read-only user or a user in a read-only database is not permitted to disable read-only mode on a connection.

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

I log in with other user,and set permission chmod 777 for the folder which i installed hadoop and hive,i can use hive. But when i log on the other user,it's error. I mean,i have to set permission when i log on to use hive on hadoop. How can use hive on hadoop with one time configure permission ????

like image 670
Duy Minh Nguyễn Avatar asked Mar 15 '12 04:03

Duy Minh Nguyễn


People also ask

How can multiple users access Hive?

The People feature allows you to grant other users access to your Hive home devices. Different levels of permissions can be granted to multiple users, who will then be able to access your devices while logged into their own personal accounts.

Can multiple users use one Metastore in Hive?

The embedded metastore service communicates with the metastore database over JDBC. This mode allows us to have multiple Hive sessions, i.e. multiple users can use the metastore at the same time.


2 Answers

I can't tell you WHY this worked but it fixed it for me.

cd ../hive/metatstore_db/
rm *.lck

I had an issue with my hadoop account and root account having seperate locks.

like image 154
Dan Ciborowski - MSFT Avatar answered Sep 28 '22 07:09

Dan Ciborowski - MSFT


I had the same issue and resolved it by the following way. The issue is because of two possible reasons.

  • Either, the user you logged in as (do 'whoami' ) does not have write access to the derby metastore database directory used by Hive. So, go to /var/lib/hive/metastore/metastore_db (this is the default in most cases) and verify if your user id has permissions by doing an ls. In case your userid does not have permissions, you should ask the owner of the directory to grant write permissions to you. So, login as the owner/the super user and execute

cd /var/lib/hive/metastore/metastore_db

chmod a+rwx . --recursive

Be warned that this will give permissions to all users. Tweak r-w-x bits accordingly though.

  • The other possible reason is that derby is a single user database. So, please clear the lock files by going to

cd /var/lib/hive/metastore/metastore_db

rm *.lck

like image 29
Jagadish Avatar answered Sep 28 '22 08:09

Jagadish