title: Execute start-dfs.sh fail to start hdfs daemons
body: <p>I am very confused about Hadoop configuration about core-site.xml and hdfs-site.xml. I feel that start-dfs.sh script not actually use the setting. I use hdfs user to format the Namenode successfully but execute start-dfs.sh can not start hdfs daemons. Can anyone help me! here is the error message:</p>
  
  <pre><code>[hdfs@I26C ~]$ start-dfs.sh 
  Starting namenodes on [I26C]
  I26C: mkdir: cannot create directory ‘/hdfs’: Permission denied
  I26C: chown: cannot access ‘/hdfs/hdfs’: No such file or directory
  I26C: starting namenode, logging to /hdfs/hdfs/hadoop-hdfs-namenode-I26C.out
  I26C: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 159: /hdfs/hdfs/hadoop-hdfs-namenode-I26C.out: No such file or directory
  I26C: head: cannot open ‘/hdfs/hdfs/hadoop-hdfs-namenode-I26C.out’ for reading: No such file or directory
  I26C: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 177: /hdfs/hdfs/hadoop-hdfs-namenode-I26C.out: No such file or directory
  I26C: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 178: /hdfs/hdfs/hadoop-hdfs-namenode-I26C.out: No such file or directory
  10.1.226.15: mkdir: cannot create directory ‘/hdfs’: Permission denied
  10.1.226.15: chown: cannot access ‘/hdfs/hdfs’: No such file or directory
  10.1.226.15: starting datanode, logging to /hdfs/hdfs/hadoop-hdfs-datanode-I26C.out
  10.1.226.15: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 159: /hdfs/hdfs/hadoop-hdfs-datanode-I26C.out: No such file or directory
  10.1.226.16: mkdir: cannot create directory ‘/edw/hadoop-2.7.2/logs’: Permission denied
  10.1.226.16: chown: cannot access ‘/edw/hadoop-2.7.2/logs’: No such file or directory
  10.1.226.16: starting datanode, logging to /edw/hadoop-2.7.2/logs/hadoop-hdfs-datanode-I26D.out
  10.1.226.16: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 159: /edw/hadoop-2.7.2/logs/hadoop-hdfs-datanode-I26D.out: No such file or directory
  10.1.226.15: head: cannot open ‘/hdfs/hdfs/hadoop-hdfs-datanode-I26C.out’ for reading: No such file or directory
  10.1.226.15: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 177: /hdfs/hdfs/hadoop-hdfs-datanode-I26C.out: No such file or directory
  10.1.226.15: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 178: /hdfs/hdfs/hadoop-hdfs-datanode-I26C.out: No such file or directory
  10.1.226.16: head: cannot open ‘/edw/hadoop-2.7.2/logs/hadoop-hdfs-datanode-I26D.out’ for reading: No such file or directory
  10.1.226.16: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 177: /edw/hadoop-2.7.2/logs/hadoop-hdfs-datanode-I26D.out: No such file or directory
  10.1.226.16: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 178: /edw/hadoop-2.7.2/logs/hadoop-hdfs-datanode-I26D.out: No such file or directory
  Starting secondary namenodes [0.0.0.0]
  0.0.0.0: mkdir: cannot create directory ‘/hdfs’: Permission denied
  0.0.0.0: chown: cannot access ‘/hdfs/hdfs’: No such file or directory
  0.0.0.0: starting secondarynamenode, logging to /hdfs/hdfs/hadoop-hdfs-secondarynamenode-I26C.out
  0.0.0.0: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 159: /hdfs/hdfs/hadoop-hdfs-secondarynamenode-I26C.out: No such file or directory
  0.0.0.0: head: cannot open ‘/hdfs/hdfs/hadoop-hdfs-secondarynamenode-I26C.out’ for reading: No such file or directory
  0.0.0.0: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 177: /hdfs/hdfs/hadoop-hdfs-secondarynamenode-I26C.out: No such file or directory
  0.0.0.0: /edw/hadoop-2.7.2/sbin/hadoop-daemon.sh: line 178: /hdfs/hdfs/hadoop-hdfs-secondarynamenode-I26C.out: No such file or directory
  </code></pre>
  
  <p>Here is the info about my deployment</p>
  
  <p>master: </p>
  
  <pre><code> hostname: I26C
   IP:10.1.226.15
  </code></pre>
  
  <p>Slave:</p>
  
  <pre><code> hostname:I26D
   IP:10.1.226.16
  </code></pre>
  
  <p>Hadoop version: 2.7.2</p>
  
  <p>OS: CentOS 7</p>
  
  <p>JAVA: 1.8</p>
  
  <p>I have create four users:</p>
  
  <pre><code>groupadd hadoop
  useradd -g hadoop hadoop
  useradd -g hadoop hdfs
  useradd -g hadoop mapred
  useradd -g hadoop yarn
  </code></pre>
  
  <p>The HDFS namenode and datanode dir privileges :</p>
  
  <pre><code>drwxrwxr-x. 3 hadoop hadoop 4.0K Apr 26 15:40 hadoop-data
  </code></pre>
  
  <p>The core-site.xml setting:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;property&gt;
      &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;
      &lt;value&gt;/edw/hadoop-data/&lt;/value&gt;
      &lt;description&gt;Temporary Directory.&lt;/description&gt;
    &lt;/property&gt;
    &lt;property&gt;
      &lt;name&gt;fs.defaultFS&lt;/name&gt;
      &lt;value&gt;hdfs://10.1.226.15:54310&lt;/value&gt;
    &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The hdfs-site.xml setting:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;property&gt;
      &lt;name&gt;dfs.replication&lt;/name&gt;
      &lt;value&gt;2&lt;/value&gt;
      &lt;description&gt;Default block replication.
    The actual number of replications can be specified when the file is created.
    The default is used if replication is not specified in create time.
      &lt;/description&gt;
    &lt;/property&gt;
    &lt;property&gt;
      &lt;name&gt;dfs.namenode.name.dir&lt;/name&gt;
      &lt;value&gt;file:///edw/hadoop-data/dfs/namenode&lt;/value&gt;
      &lt;description&gt;Determines where on the local filesystem the DFS name node should store the name table(fsimage). If this is a comma-delimited list of directories then the name table is replicated in all of the directories, for redundancy.
      &lt;/description&gt;
    &lt;/property&gt;
    &lt;property&gt;
      &lt;name&gt;dfs.blocksize&lt;/name&gt;
      &lt;value&gt;67108864&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
      &lt;name&gt;dfs.namenode.handler.count&lt;/name&gt;
      &lt;value&gt;100&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
      &lt;name&gt;dfs.datanode.data.dir&lt;/name&gt;
      &lt;value&gt;file:///edw/hadoop-data/dfs/datanode&lt;/value&gt;
      &lt;description&gt;Determines where on the local filesystem an DFS data node should store its blocks. If this is a comma-delimited list of directories, then data will be stored in all named directories, typically on different devices. Directories that do not exist are ignored.
      &lt;/description&gt;
    &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>