¶ Active-standby 상태 관리
$ hdfs haadmin -getAllServiceState
hdfs01.encore.rnd:8020 standby
hdfs02.encore.rnd:8020 standby
$ hdfs haadmin -transitionToActive nn1 --forcemanual
You have specified the --forcemanual flag. This flag is dangerous, as it can induce a split-brain scenario that WILL CORRUPT your HDFS namespace, possibly irrecoverably.
It is recommended not to use this flag, but instead to shut down the cluster and disable automatic failover if you prefer to manually manage your HA state.
You may abort safely by answering 'n' or hitting ^C now.
Are you sure you want to continue? (Y or N) y
2022-07-12 09:20:11,549 WARN ha.HAAdmin: Proceeding with manual HA state management even though
automatic failover is enabled for NameNode at hdfs02.encore.rnd/192.168.1.152:8020
2022-07-12 09:20:11,786 WARN ha.HAAdmin: Proceeding with manual HA state management even though
automatic failover is enabled for NameNode at hdfs01.encore.rnd/192.168.1.151:8020
# standby 상태로 변경
hdfs haadmin -transitionToStandby nn1 --forcemanual
$ hdfs haadmin -transitionToObserver nn2 --forcemanual
You have specified the --forcemanual flag. This flag is dangerous, as it can induce a split-brain scenario that WILL CORRUPT your HDFS namespace, possibly irrecoverably.
It is recommended not to use this flag, but instead to shut down the cluster and disable automatic failover if you prefer to manually manage your HA state.
You may abort safely by answering 'n' or hitting ^C now.
Are you sure you want to continue? (Y or N) y
2022-07-12 09:22:23,655 WARN ha.HAAdmin: Proceeding with manual HA state management even though
automatic failover is enabled for NameNode at hdfs02.encore.rnd/192.168.1.152:8020