关于正常计划性地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 |
