I had to deal with the same issue and kept getting the following exception:
Starting namenodes on [localhost]
Starting datanodes
localhost: ERROR: Cannot set priority of datanode process 8944
Starting secondary namenodes [MBPRO-0100.local]
2019-07-22 09:56:53,020 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
As others have mentioned, you need to first make sure that all path parameters are set correctly which is what I checked first. Then followed these steps to solve the issue:
1- Stop dfs service and format hdfs:
sbin/stop-dfs.sh
sudo bin/hdfs namenode -format
2- Change permissions for the hadoop temp directory:
sudo chmod -R 777 /usr/local/Cellar/hadoop/hdfs/tmp
3- Start service again:
sbin/start-dfs.sh
Good luck
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…