namenode在重启pc后不能启动(hadoop 2.7.3)

juzqafwq  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(509)

我已经在ubuntu16.04上配置了hadoop2.7.3并运行all(wordcount和其他mapreduce运行all)。重新启动pc后,我启动start dfs,但namenode没有启动。其他指南说删除临时目录,但我没有。
这些是我的文件:
core-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>
prdp8dxp

prdp8dxp1#

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

相关问题