Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

permission issue between hive and nifi

avatar
Expert Contributor

Hi,

I'm having some permission issue with Hive. I wrote a file in HDFS using the PutHDFS nifi processor.

When i try to create a table from this location in Hive Ambari view i get this error message :

H110 Unable to submit statement. Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [admin] does not have [READ] privilege on [hdfs://sandbox.hortonworks.com:8020/tmp/fb_post_name2] [ERROR_STATUS]

I can fix that by typing :

 sudo -u hdfs hadoop fs chown -R admin /tmp/fb_post_name2

sudo -u hdfs hadoop fs chmod 777 /tmp/fb_post_name2

But do i have a way to make it automatic (with the executeProcess processor for instance)?

Thank you in advance.

1 ACCEPTED SOLUTION

avatar
Master Guru

If NiFi is running as a user that can change permissons in HDFS, you should be able to use the following properties in PutHDFS to do the chown/chmod:

Permissions umask

Remote Owner

Remote Group

...according to the documentation: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.hadoop.PutHDFS/index.ht...

View solution in original post

3 REPLIES 3

avatar
Master Guru

If NiFi is running as a user that can change permissons in HDFS, you should be able to use the following properties in PutHDFS to do the chown/chmod:

Permissions umask

Remote Owner

Remote Group

...according to the documentation: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.hadoop.PutHDFS/index.ht...

avatar
Expert Contributor

@mburgess

Thank you very much. I tried to change the remote Owner but apparently i was not executing nifi as super user. So i went to the shell, stopped nifi and typed :

sudo bash /opt/nifi-1.1.1.0-12/bin/nifi.sh start

However i'm still not considered as super user. Should i change something in the configuration of nifi?

avatar
Master Guru

Being the client OS superuser doesn't imply that user is a superuser on HDFS. You'd need to add a user to Hadoop with the same UID and GID as your client user, and make the Hadoop user a superuser on that system, or better yet, just give the user the permissions it needs for the desired folder(s): http://stackoverflow.com/questions/24184306/how-to-add-user-in-supergroup-of-hdfs-in-linux