1、首先在Active上执行以下命令,手动备份整个name目录:
1 |
|
2、在Standby上备份整个name和journal目录,在执行:
1 | hadoop-daemon.sh stop zkfc |
若报以下错:
FATAL ha.BootstrapStandby: Unable to read transaction ids 10-100 from the configured shared edits storage qjournal://1.1.1.1:8485;1.1.1.2:8485/sec-hdfs-cluster. Please copy these logs into the shared edits storage or call saveNamespace on the active node.
Error: Gap in transactions. Expected to be able to read up until at least txid 10 but unable to find any edit logs containing txid 10
需要将Active整个name目录复制到Standby,然后启动namenode:1
2scp -r /data/hadoop/name $standby_ip:/data/hadoop
hadoop-daemon.sh start namenode