service relocating and failover
Hi all,
I woluf like to use different service name on a 2-nodes RAC to manually control which nodes clients connect to.
I set up:
- a "global service", which is running on both instances
- a "node1" service, which has instance 1 as preferred and instance 2 as available
- a "node2" service, which has instance 2 as preferred and instance 1 as available
So I can choose where to connect.
However, if I stop one instance or if I reboot one one, clients connected to the "global" service are failed over to the surviving node, the service is switched to the surviving available instance, but clients connected to the switched service are not failed over.
How can I correct this situation? I would like to have all clients failing over to the surviving node.
Moreover, when a node restart the service is not failed back to its preferred node.
How can I force this?
A full list of commands used to manage services follows.
thanks for every answer!
andrea
-------------------------------
-- create and start aditional services
[oracle@giallo ~]$ srvctl add service -d asr -s asrgiallo -r "asr1" -a "asr2" -P BASIC
[oracle@giallo ~]$ srvctl add service -d asr -s asrrosso -r "asr2" -a "asr1" -P BASIC
[oracle@giallo admin]$ srvctl start service -d asr -s asrgiallo
[oracle@giallo admin]$ srvctl start service -d asr -s asrrosso
-- clients will connect using these tnsnames entreis
ASR_giallo =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = giallo-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rosso-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = asrgiallo.noemalife.loc)
)
)
ASR_rosso =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = giallo-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rosso-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = asrrosso.noemalife.loc)
)
)
-- reboot first node
[root@giallo ~]# reboot
-- now clients connected to ASR_giallo are disconnected:
-- every query results in end-of-file on commuication channel
-- check service status
[oracle@giallo ~]$ srvctl status service -d asr -s asrgiallo
Service asrgiallo is running on instance(s) asr2
[oracle@giallo ~]$
[oracle@giallo ~]$ srvctl status service -d asr -s asrrosso
Service asrrosso is running on instance(s) asr2
[oracle@giallo ~]$
-- restart the service to have it back on its preferred node
[oracle@giallo ~]$ srvctl stop service -d asr -s asrgiallo
[oracle@giallo ~]$ srvctl status service -d asr -s asrgiallo
Service asrgiallo is not running.
[oracle@giallo ~]$
[oracle@giallo ~]$ srvctl status service -d asr -s asrrosso
Service asrrosso is running on instance(s) asr2
[oracle@giallo ~]$
[oracle@giallo ~]$ srvctl status database -d asr
Instance asr1 is running on node giallo
Instance asr2 is running on node rosso
[oracle@giallo ~]$ srvctl start service -d asr -s asrgiallo
[oracle@giallo ~]$ srvctl status service -d asr -s asrgiallo
Service asrgiallo is running on instance(s) asr1