b.设置了auto_set_online > 0(抖动状态除外)
Host is running without any problems.
host was set to offline manually.
Host is offline (Check ping and/or mysql failed)
Host is awaiting recovery
replication backlog is too big (Check rep_backlog failed)
replication threads are not running (Check rep_threads failed)
Only hosts with state ONLINE may have roles. When a host switches from ONLINE to any other state, all roles will be removed from it.
A host that was in state REPLICATION_DELAY or REPLICATION_FAIL will be switched back to ONLINE if everything is OK again, unless it is flapping (see Flapping).
A host that was in state HARD_OFFLINE will be switched to AWAITING_RECOVERY if everything is OK again. If its downtime was shorter than 60 seconds and it wasn't rebooted or auto_set_online is > 0 it will be switched back to ONLINE automatically, unless it is flapping (see Flapping again).
Replication backlog or failure on the active master isn't considered to be a problem, so the active master will never be in state REPLICATION_DELAY or REPLICATION_FAIL.
Replication backlog or failure will be ignored on hosts whos peers got ONLINE less than 60 seconds ago (That's the default value of master-connect-retry).
If both checks rep_backlog and rep_threads fail, the state will change to REPLICATION_FAIL.
If auto_set_online is > 0, flapping hosts will automatically be set to ONLINE after flap_duration seconds.