解决方案:
查看nn1的状态
hdfs haadmin -getServiceState nn1
standby
hdfs haadmin -getServiceState nn2
active
修改nn2为standby状态
hdfs haadmin -transitionToStandby --forcemanual nn2
修改nn1为active状态
hdfs haadmin -transitionToActive --forcemanual nn1
最后结果:
hdfs haadmin -getServiceState nn1
active
hdfs haadmin -getServiceState nn2
standby