HDFS principle
HDFS comprising three components:
NameNode, DataNode, SecondaryNameNode
- NameNode role is to store metadata (file name, creation time, size, permissions, and block mapping between blocks, etc.)
- DataNode real role is to store data
- SecondaryNameNode role fsimage file and merge edits
hadoop.tmp.dir -> /tmp/hadoop-root
dfs.namenode.dfs.dir ->/dfs/name/current
see_txid: operation transaction id, number, for displaying the number of operations, each operation is incremented by one
VERSION: display namespaceID clusterID
Namenode modify the storage location of:
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
<property>
<property>
<name>dfs.namenode.name.dir<name>
<value>/opt/module/hadoop-2.6.0/data</value>
</property>
</configuration>
dfs.datanode.data.dir -> /tmp/hadoop-root/dfs/data
Modify the storage directory datanode
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
<property>
<property>
<name>dfs.datanode.data.dir<name>
<value>/opt/module/hadoop-2.6.0/data</value>
</property>
</configuration>
Modify the directory secondarynamenode
file://${hadoop.tmp.dir}/dfs/namesecondary
Reformatted
hdfs namenode -format -force
Repeatedly explained formatting issues of namenode
hdfs formatting file will change VERSION clusterID, when the first and formatting datannode namenode produce the same clusterID;
If you re-execute clusterID will change the format, namenode, it will datanode of clusterID inconsistent with, or if you restart the reader will hang hdfs
You need to manually modify