Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How can I fix incorrect file permissions for set-hdfs-plugin-env.sh when restarting from ambari

Solved Go to solution
Highlighted

How can I fix incorrect file permissions for set-hdfs-plugin-env.sh when restarting from ambari

Contributor

Ambari sets up set-hdfs-plugin-env.sh with root:hadoop 700 permissions when it restarts HDFS, this causes ranger integration to break as the hdfs user cannot execute this script when the namenode starts.

I can fix the problem if I restart the namenode manually, but that means to deploy config changes I need to restart from Ambari, then correct permissions and restart manually.

How

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How can I fix incorrect file permissions for set-hdfs-plugin-env.sh when restarting from ambari

New Contributor

You can use the following work-around:

On the namenode box,

  • login as root
  • execute:
# cp /etc/hadoop/conf/set-hdfs-plugin-env.sh /etc/hadoop/conf/set-hdfs-plugin-env-permfix.sh
# chown hdfs:hadoop /etc/hadoop/conf/set-hdfs-plugin-env-permfix.sh

  • Then edit, /usr/hdp/current/hadoop-client/libexec/hadoop-config.sh file to modify the references to set-hdfs-plugin-env.sh to " set-hdfs-plugin-env-permfix.sh"

This workaround should help you to start the namenode from Ambari without having to change permission manually every time.

6 REPLIES 6

Re: How can I fix incorrect file permissions for set-hdfs-plugin-env.sh when restarting from ambari

what hdp version is this?

Re: How can I fix incorrect file permissions for set-hdfs-plugin-env.sh when restarting from ambari

Contributor

This is HDP 2.2.6, Ambari 2.1.2.1

Re: How can I fix incorrect file permissions for set-hdfs-plugin-env.sh when restarting from ambari

New Contributor

what is umask value for the root user ? This may have set the file to have no execute permission for the group.

Re: How can I fix incorrect file permissions for set-hdfs-plugin-env.sh when restarting from ambari

Contributor

The root user's umask is 0027

Re: How can I fix incorrect file permissions for set-hdfs-plugin-env.sh when restarting from ambari

New Contributor

You can use the following work-around:

On the namenode box,

  • login as root
  • execute:
# cp /etc/hadoop/conf/set-hdfs-plugin-env.sh /etc/hadoop/conf/set-hdfs-plugin-env-permfix.sh
# chown hdfs:hadoop /etc/hadoop/conf/set-hdfs-plugin-env-permfix.sh

  • Then edit, /usr/hdp/current/hadoop-client/libexec/hadoop-config.sh file to modify the references to set-hdfs-plugin-env.sh to " set-hdfs-plugin-env-permfix.sh"

This workaround should help you to start the namenode from Ambari without having to change permission manually every time.

Re: How can I fix incorrect file permissions for set-hdfs-plugin-env.sh when restarting from ambari

Contributor

Yeah, I've thought about that, I don't like it... it's one more thing that's hacked together manually and has to be tracked and maintained. I'd much prefer a fix to Ambari's config...

Don't have an account?
Coming from Hortonworks? Activate your account here