我遵循了这个步骤post:httphttp://hanslen.me/2018/01/19/how-to-install-hadoop-on-macos-high-sierra/在本地计算机上启动hadoop。但是,我在尝试启动namenode和datanode时遇到了这个错误。我确实尝试设置了中第一个解决方案给出的路径:hdfs\u namenode\u user、hdfs\u datanode\u user和hdfs\u secondarynamenode\u user未定义,但似乎没有帮助。我不断得到以下错误:
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
有什么建议吗?
编辑:添加core-site.xml和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>
暂无答案!
目前还没有任何答案,快来回答吧!