Cannot change file ownership from bash script -
i trying run command
chown -r "$user" /mnt/namenode
from bash script change ownership of namenode folder , sub-folders. when type command manually
sudo chown -r ubuntu /mnt/namenode
it works, not when script. script, ownership of namenode changing, not subfolders. know how might fix this?
ok, got it. script formatting namenode after ownership had been set. before format, subfolders has correct ownership recursively. after format, sub-folders' ownership changing root. made following change:
echo 'y' | /home/$user/hadoop-2.2.0/bin/hadoop namenode -format sudo chown -r $user:$user /mnt/namenode sudo chown -r $user:$user /mnt/datanode
in other words, set ownership after did formatting.
try this:
chown -r $user:$user /mnt/namenode
Comments
Post a Comment