How to Relocate SCAN and SCAN_LISTENER

  • by

Theoretically, the cluster distributes all SCAN VIP across all nodes evenly according to some algorithm, but sometimes you would like to relocate their host node.

In this case, we have 4 SCAN VIP and of course 4 SCAN_LISTENER distributed like this:

[grid@primary01 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node primary02
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node primary01
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node primary01
SCAN VIP scan4 is enabled
SCAN VIP scan4 is running on node primary02
[grid@primary01 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node primary02
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node primary01
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node primary01
SCAN Listener LISTENER_SCAN4 is enabled
SCAN listener LISTENER_SCAN4 is running on node primary02

As we can see, the host nodes of those SCAN IP are 2, 1, 1, 2.

Suppose we would like the first SCAN VIP to reside in node 1. We can do this:

[grid@primary01 ~]$ srvctl relocate scan -i 1 -n primary01

Or this:

[grid@primary01 ~]$ srvctl relocate scan_listener -i 1 -n primary01

Either way works well. That is to say, SCAN_LISTENER is also relocated while we relocate SCAN VIP, or vice versa.

After relocating the first SCAN VIP, we can check the result.

[grid@primary01 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node primary01
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node primary01
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node primary01
SCAN VIP scan4 is enabled
SCAN VIP scan4 is running on node primary02
[grid@primary01 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node primary01
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node primary01
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node primary01
SCAN Listener LISTENER_SCAN4 is enabled
SCAN listener LISTENER_SCAN4 is running on node primary02

In some situations, you might see some nodes are at a difficult time, but you have no idea how to redistribute those SCAN VIP among nodes, I think you may consider to just restart SCAN by srvctl and leave the problem to the cluster to do its best judge.

Leave a Reply

Your email address will not be published. Required fields are marked *