Problem scenario
You run sudo bash start-yarn.sh
but you receive this message:
ERROR: Attempting to operate on yarn resourcemanager as root
ERROR: but there is no YARN_RESOURCEMANAGER_USER defined. Aborting operation.
What should you do?
Solution
1. Modify start-yarn.sh. Underneath the last section of comments, place three lines with the following text:
YARN_RESOURCEMANAGER_USER=root
HADOOP_SECURE_DN_USER=yarn
YARN_NODEMANAGER_USER=root
2. Modify stop-yarn.sh. Underneath the last section of comments, place three lines with the following text:
YARN_RESOURCEMANAGER_USER=root
HADOOP_SECURE_DN_USER=yarn
YARN_NODEMANAGER_USER=root
In most cases, you would not use sudo
to start yarn. To learn how to set up a multi-node cluster of open source Hadoop that can be administered with a user without sudoer rights, see this posting.