If you have a script or a command to execute in another user, assume that the Hadoop command to execute in Hadoop user from any users, use the below commands,
$ su -s /bin/bash - hadoop -c 'hadoop dfsadmin -report'
or
$ runuser -l hadoop -c 'hadoop dfsadmin -report'
You will get the Hadoop report.
Comments (0)