Thursday 1 October 2015

Error occurred executing hive query: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [hue] does not have [USE] privilege on [default]

The Solution to the following issue is:-

Error occurred executing hive query: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [hue] does not have [USE] privilege on [default]

Step 1:-

Change the file permission to 777 for the following files in conf and conf.server locations:-
/etc/hive/ conf/hive-site.xml file 
/etc/hive / conf.server /hive-site.xml
/etc/hive/conf/hiveserver2-site.xml  
/etc/hive/conf.server/hiveserver2-site.xml
For example: chmod 777 /etc/hive/ conf/hive-site.xml

Step 2:-

Change the property values for hive-site.xml files in locations conf and conf.server
Make sure the following property value is set to false:-
   <property>
     <name>hive.security.authorization.enabled</name>
     <value>false</value>
   </property>

Change the below property value to org.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider:-
<property>
<name>hive.security.metastore.authorization.manager</name>
<value>org.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider,org.apache.hadoop.hive.ql.security.authorization.MetaStoreAuthzAPIAuthorizerEmbedOnly</value>
</property>

For Example:-
   <property>
   <name>hive.security.metastore.authorization.manager</name>
   <value>org.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider</value>
   </property>

Step 3:-

Change the property values for hiveserver2-site.xml files in locations conf and conf.server
Make sure the following property value is set to false:-
   <property>
       <name>hive.security.authorization.enabled</name>
       <value>false</value>
   </property>

Step 4:-

Change the file permission to 777 for the hdfs-site.xml file in conf location:-

For example: Chmod 777 /etc/hadoop/conf/hdfs-site.xml

Step 5:-

Change the property values for hdfs-site.xml files in conf location.
Make sure the following property value is set to false:-

<property>
<name>dfs.permissions.enabled</name>
<value>false</value>
</property>

Step 6:-

Now restart the hive services in ambari window: localhost: 8080.

Step 7:-

Now open the hue interface: localhost:8000 and click on Beeswax (Hive UI) in the menu.

Step 8:-

Execute the below query in the query editor:-
set admin role;

Now the result of the query will be displayed. Hope this works well.


--Good luck--

14 comments:

  1. Excellent Post. It solved my Problem.

    ReplyDelete
  2. Thanks for the steps. It would be helpful for newbies like me if you explain why we are doing each of the steps you have mentioned and how it helps resolve the problem.

    ReplyDelete
  3. WOrked perfect

    ReplyDelete
  4. Thank you.Well it was nice post and very helpful information on
    Hadoop Admin Online Course India

    ReplyDelete
  5. Thank you. It solved my problems.

    ReplyDelete
  6. awesome post presented by you..your writing style is fabulous and keep update with your blogs Big data hadoop online Course Hyderabad

    ReplyDelete