重启pc后,Namenode无法启动(hadoop 2.7.3)

时间:2017-04-04 12:46:43

标签: apache ubuntu hadoop namenode bigdata

我在ubuntu 16.04上配置了hadoop 2.7.3并运行全部(字数和其他mapReduce运行全部)。 重新启动pc后,我启动了start-dfs,但是namenode没有启动。其他指南说删除temporay目录,但我没有。

这是我的文件:

芯-site.xml中

<configuration>
 <property>
   <name>fs.defaultFS</name>
   <value>hdfs://localhost:9000</value>
 </property>
</configuration>

HDFS-site.xml中

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

1 个答案:

答案 0 :(得分:0)

Step 1: Create the folders like below:
      -- sudo mkdir /dfs
      -- sudo chown username:username /dfs/*
      -- sudo chmod 755 /dfs/
      -- cd /dfs
      If the machine is name node then:
          -- mkdir nn 
      if data node: 
          -- mkdir data

Step 2:
add below properties in hdfs-site.xml
<configuration>
        <configuration>
            <property>
                <name>dfs.replication</name>
                <value>1</value>
            </property>
        </configuration>
        <configuration>
            <property>
                <name>dfs.namenode.name.dir</name>
                <value>/dfs/nn</value>
            </property>
        </configuration>
        <configuration>
            <property>
                <name>dfs.datanode.data.dir</name>
                <value>/dfs/data</value>
            </property>
        </configuration>


</configuration>
step 3:
 format the namenode: hadoop namenode -format
step 4:
 start all services