How Do You Troubleshoot the Message “ERROR: but there is no HDFS_DATANODE_USER defined.”?

Problem scenarios
One of the following apply to you.

Situation 1:
You run "start-dfs.sh" and it seems to work, but the "jps" command does not show that "DataNode" is running.

OR

Situation 2:
You run "sudo bash start-dfs.sh" but you receive this message:

ERROR: Attempting to operate on hdfs datanode as root
ERROR: but there is no HDFS_DATANODE_USER defined. Aborting operation.
ERROR: Attempting to operate on hdfs secondarynamenode as root
ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.

Solution
1. Modify start-dfs.sh. Find the comment "e.g., HDFS_DATANODE_USER=root HADOOP_SECURE_DN_USER=hdfs". Underneath the comment section, place these four stanzas:

HDFS_DATANODE_USER=root
HDFS_DATANODE_SECURE_USER=hdfs
HDFS_NAMENODE_USER=root
HDFS_SECONDARYNAMENODE_USER=root

2. Modify stop-dfs.sh. Find the comment "e.g., HDFS_DATANODE_USER=root HADOOP_SECURE_DN_USER=hdfs". Underneath the comment section, place these four stanzas:

HDFS_DATANODE_USER=root
HDFS_DATANODE_SECURE_USER=hdfs
HDFS_NAMENODE_USER=root
HDFS_SECONDARYNAMENODE_USER=root

3. Try "sudo jps". Without sudo, jps could return fewer services than are actually running. In most cases, you would not use "sudo" to start dfs. 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.

Leave a comment

Your email address will not be published. Required fields are marked *