I have summarized several HDFS ha mechanisms and compared them from several perspectives. For more information, see the following table classes.
Solution |
Description |
Advantages |
Disadvantages |
Recovery Method |
Secondnarynamenode |
Regularly download fsimage, editlog, and checkpoint on the host to merge them into a large file fsimage. |
Reduced namenode recovery time |
Only backup solutions are provided, and data may still be lost. data inconsistency may take a long time to recover. |
Restore Based on the fsimage of the slave machine |
Backup namenode |
Namenode synchronizes metadata operations to backupnode, while backupnode performs editlog updates and implements checkpoint storage independently. |
The metadata operation is successful on both the master and slave databases, and the data is consistent. |
Backup does not have the block report information. When restoring, datanode must report the block information, so it still takes some time. |
Use the metadata file on the backup to restore data. |
Avata |
Datanode blockreport: master-slave namenode. The master writes logs to NFS. The slave periodically reads the logs in NFS and merges them to the memory. |
Hot Standby switchover for short Data Consistency |
The complexity is relatively high. You still need to switch manually. During switchover, you need to pay attention to the backup application to all the logs before providing services. |
When namenode fails, you need to manually confirm that the virtual IP address is manually switched to the backup machine. |
Hadoop2.0 |
Similar to avata, the shared storage (SAN, etc.) is used to continuously monitor the logs of shared storage from nodes (upgrade to active, ensure that the log application is complete) and change the application to itself. |
Hot standby |
Not quite mature |
Manual Switch |
DRBD |
Relies on mature DRBD for metadata backup |
High backup Efficiency |
Hot Standby switchover is not performed for a long time |
Enable the NameNode of the slave machine to read the backup metadata of DRBD. |