SNN consolidation process

  SNN is used to save namenode in the backup information for the HDFS metadata and reduce namenode restart time, SNN process runs by default namenode machine on, if this machine errors, downtime, recovery HDFS file system is a big disaster , so the best way is to SNN process is configured to run on another machine.

  In the hadoop, NameNode HDFS responsible for persistent storage of metadata, and the process of interaction feedback HDFS various operations from the client. In order to ensure interactive speed, metadata HDFS file system is to load namenode machine's memory, and will save the data in memory to disk for persistent storage. In order to ensure that this process does not become a bottleneck persistent HDFS operations.

  hadoop strategy adopted is: HDFS most recent operation saved to namenode one called file Editlog the go. When the restart namenode, in addition to the load fslmage, but also on the Editlog file recorded in HDFS operations Replay , to restore the state before the final restart HDFS. And SecondaryNameNode, will periodically recorded Editlog HDFS operations merged into a checkpoint and then emptied Editlog . So namenode will restart Load latest a checkpoint, and replay hdfs operation Editlog recorded, due Editlog is recorded after a checkpoint from the list of operations to now, it will be relatively small. Without this cyclical process of consolidation snn, then each restart when namenode and they will take a long time. And this can reduce the time merge periodic restart. HDFS can also ensure the integrity of the system. This is SecondaryNameNode doing things. So SNN does not share the pressure on HDFS interactive operations on namenode. Nevertheless, when namenode namenode machine downtime or process problems, namenode the daemon process, you can copy metadata from snn artificial way to restore the HDFS file system.

  SNN works:

  1, SecondaryNameNode notice NameNode ready to submit edits the file, then namenode node generates edits.new

  2, SecondaryNameNode http get by way of acquisition of the NameNode fsimage and edits the file (in the same directory SecondaryNameNode current temp.check-point can be seen or previous-checkpoint directories that are stored by copying from namenode image file).

  3, SecondaryNameNode starts combined on the acquired two files , create a new file fsimage fsimage.ckpt . 4, SecondaryNameNode a http post way transmission fsimage.ckpt to the NameNode . 5, with the NameNode fsimage.ckpt edits.new the files are renamed as fsimage and edits, and then update fstime , the entire checkpoint process ends.

Guess you like

Origin www.cnblogs.com/xiangyuguan/p/11006253.html