Failed to start daemons using start-dfs.sh

We use the cdh4-0.0 distribution from cloudera. We cannot start the daemons using the command below.

>start-dfs.sh
Starting namenodes on [localhost]
hduser@localhost password: 
localhost: mkdir: cannot create directory `/hduser': Permission denied
localhost: chown: cannot access `/hduser/hduser': No such file or directory
localhost: starting namenode, logging to /hduser/hduser/hadoop-hduser-namenode-canberra.out
localhost: /home/hduser/work/software/cloudera/hadoop-2.0.0-cdh4.0.0/sbin/hadoop-daemon.sh: line 150: /hduser/hduser/hadoop-hduser-namenode-canberra.out: No such file or directory
localhost: head: cannot open `/hduser/hduser/hadoop-hduser-namenode-canberra.out' for reading: No such file or directory
+5
source share
1 answer

Sounds like you're using tarballs?

Try setting the HADOOP_LOG_DIRdefault location override to the configuration file etc/hadoop/hadoop-env.shas follows:

export HADOOP_LOG_DIR=/path/to/hadoop/extract/logs/

And then try again sbin/start-dfs.sh, and it should work.

In packaged environments, start-stop scripts are configured to provide a unique location for each type of service through the same HADOOP_LOG_DIRenv-var, so they do not have the same problem as you.

If you use packages instead, do not use these scripts, but simply run:

service hadoop-hdfs-namenode start
service hadoop-hdfs-datanode start
service hadoop-hdfs-secondarynamenode start
+1

All Articles