4
votes

I'm trying to install hadoop on my mac.

What I did are

brew install hadoop 
*in hadoop-env.sh: set JAVA_HOME and HADOOP_OPTS*

Then, I tried start-dfs.sh, but the following error came up:

AL01299205:hadoop user$ /usr/local/Cellar/hadoop/3.2.1/sbin/start-dfs.sh

Starting namenodes on [AL01299205.local]

AL01299205.local: ERROR: Cannot set priority of namenode process 24897

Starting datanodes Starting secondary namenodes [AL01299205.local]

AL01299205.local: ERROR: Cannot set priority of secondarynamenode process 25147

2020-02-19 18:06:08,843 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

How can I fix this error?

1

1 Answers

-2
votes

I additionally edited some files as follows:

hadoop-evn.sh

export HADOOP_OPTS="$HADOOP_OPTS -Djava.net.preferIPv4Stack=true -Djava.security.krb5.realm= -Djava.security.krb5.kdc="

core-site.xml

<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:9000</value>
</property>
</configuration>

mapred-site.xml

<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9010</value>
</property>
</configuration>

hdfs-site.xml

<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>

Then the errors were gone.