1

I followed the steps in this post:http://hanslen.me/2018/01/19/How-to-install-Hadoop-on-macOS-High-Sierra/ to start hadoop on local machine. However I get this error when trying to start the Namenode and Datanode. I did try to set the path as given by the first solution in : HDFS_NAMENODE_USER, HDFS_DATANODE_USER & HDFS_SECONDARYNAMENODE_USER not defined but it does not seem to help. I keep getting the following error:

 Starting namenodes on [localhost]
    ERROR: Attempting to operate on hdfs namenode as root
    ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation.


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

Starting secondary namenodes [BANL160658074.local]
        ERROR: Attempting to operate on hdfs secondarynamenode as root
        ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation

Any suggestions on what I have to do?

EDIT: Added core-site.xml and hdfs-site.xml

core-site.xml

  <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>


    <configuration>
    <property>
            <name>hadoop.tmp.dir</name>
            <value>/usr/local/Cellar/hadoop/hdfs/tmp</value>
            <description>A base for other temporary directories.</description>
        </property>
        <property>
            <name>fs.default.name</name>
            <value>hdfs://localhost:8020</value>
        </property>
    </configuration>

hdfs-site.xml

<configuration>
 <property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>
</configuration>
  • Did you check if the variables are indeed setup properly? Try doing an echo on the variables to get the values and verify if it is coming as root. – vishad Jun 12 '18 at 06:05
  • @vishad yes I have set the variables and the echo does return root. – user6900679 Jun 12 '18 at 06:08
  • please share your core-site.xml and hdfs-site.xml files – Abhinav Jun 12 '18 at 06:11
  • @Abhinav done adding. – user6900679 Jun 12 '18 at 06:20
  • Hadoop won't run with Java 9 and above, by the way, and brew now installs Hadoop 3, which uses some different properties than that post. You're welcome to separately download older Hadoop versions – OneCricketeer Jun 12 '18 at 13:17
  • I am facing the same issue. I faced this issue when I installed Hadoop 3 using brew and also when I manually installed it via wget through the link below. Any help will be appreciated. http://tech.marksblogg.com/hadoop-3-single-node-install-guide.html – Rahul P Jul 15 '18 at 01:24

0 Answers0