1主要:把secondarynamenode 数据 迁移到namenode数据目录里,然后重启namenode
2首先知道:secondarynamenode 默认每隔一小时备份一次数据
core-site.xml
<property>
<name>fs.checkpoint.period</name>
<value>3600</value>
<description>The number of seconds between two periodic checkpoints. </description>
</property>
<property>
<name>fs.checkpoint.size</name>
<value>67108864</value>
<description>The size of the current edit log (in bytes) that triggers a periodic checkpoint even if the fs.checkpoint.period hasn't expired. </description>
</property>
<property>
<name>fs.checkpoint.dir</name>
<value>/home/hadoop/soft/hadoop-2.6.4/hdpdata/dfs/namesecondary</value>
<description>Determines where on the local filesystem the DFS secondary name node should store the temporary images to merge. If this is a comma-delimited list of directories then the image is replicated in all of the directories for redundancy. </description>
</property>
fs.checkpoint.period表示多长时间记录一次hdfs的镜像。默认是1小时。
fs.checkpoint.size表示一次记录多大的size,默认64M
3制造namenode宕机的情形 :kill -9 把namenode 杀掉
4把secondarynamenode数据拷贝到namenode目录下,然后重启namenode就ok
scp -r /home/hadoop/soft/hadoop-2.6.4/hdpdata/dfs/namesecondary hadoop@mina0:/home/hadoop/soft/hadoop-2.6.4/hdpdata/dfs/name/
5重启:先stop-all.sh,然后:start-all.sh