rac 正常關閉例項service不會自動漂移,只有在例項異常abort才會發生自動failover

darren__chan發表於2021-09-13

關於正常計劃性地shutdown 例項,服務不會自動漂移,只有在例項異常的情況下才會發生自動failover的情況。

不過我們可以在srvctl stop instance時加上 “-f“ ,作用就是讓服務自動failover到另外一個節點。

-f       This option fails the running services over to another instance. (同時也可以參考文件:How to Failover a Service During Instance Shutdown Using SRVCTL (文件 ID 1520454.1))

srvctl stop instance -d t1nnps  -i t1nnps1 -f

  以下是測試過程:

srvctl add service -d t1nnps -s oratest -r t1nnps1 -a t1nnps2 -P basic -e select -m basic -z 180 -w 5

srvctl start service -d t1nnps -s oratest

 

xxxxxx:t1nnps1 > srvctl status service -d t1nnps -s oratest

Service oratest is running on instance(s) t1nnps1《《《《《《《《《《《

 

 

srvctl config service -d t1nnps -s oratest

 

xxxxx:t1nnps1 > srvctl config service -d t1nnps -s oratest

Service name: oratest

Service is enabled

Server pool: t1nnps_oratest

Cardinality: 1

Disconnect: false

Service role: PRIMARY

Management policy: AUTOMATIC

DTP transaction: false

AQ HA notifications: false

Failover type: SELECT

Failover method: BASIC

TAF failover retries: 180

TAF failover delay: 5

Connection Load Balancing Goal: LONG

Runtime Load Balancing Goal: NONE

TAF policy specification: BASIC

Edition:

Preferred instances: t1nnps1  <<<<<<<<<<<<<<<

Available instances: t1nnps2  <<<<<<<<<<<<<<<

 

正常關閉例項,service是也正常關閉了。

 

xxxxxx:t1nnps1 > srvctl stop instance -d t1nnps  -i t1nnps1

xxxxxx:t1nnps1 > srvctl status service -d t1nnps -s oratest

Service oratest is not running. 《《《《《《《《《《《《《《《《《《《

 

 

stop instance 加上-f,可以把service failover 到另外一個例項上

 

xxxxxx:t1nnps2 > srvctl start instance -d t1nnps  -i t1nnps1

xxxxxx:t1nnps1 > srvctl status service -d t1nnps -s oratest

Service oratest is running on instance(s) t1nnps1

xxxxxx:t1nnps1 > srvctl stop instance -d t1nnps  -i t1nnps1 -f  《《《《《《《《

xxxxxx:t1nnps1 >  srvctl status service -d t1nnps -s oratest 《《《《《《《《《

Service oratest is running on instance(s) t1nnps2

 

      


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29863023/viewspace-2791878/,如需轉載,請註明出處,否則將追究法律責任。

相關文章