問題解決關鍵:多個節點存放data數據的目錄路徑相同了,造成了報告中誤認爲只有一個datanode,於是通過命令查看live datanodes的個數時候,會發現節點全部啓動,但是datanodes數目並不能正常顯示。
解決辦法:修改hdfs-site.xml文件
master中的hdfs-site.xml文件
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/usr/hadoop/hdfs/data</value>
</property>
slave1中的hdfs-site.xml文件
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/usr/hadoop/hdfs/data/node1</value>
</property>
slave1中的hdfs-site.xml文件
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/usr/hadoop/hdfs/data/node2</value>
</property>
slave1中的hdfs-site.xml文件
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/usr/hadoop/hdfs/data/node3</value>
</property>