How it works...
The focus of this recipe is on operational customization. We begin by defining a script that performs several actions on our behalf.
Say that we want a VIP to always be located on the current primary node. In the event of a switchover or failover, this means that the VIP must be moved. The easiest (but perhaps not the safest) way to do this is to connect to the VIP itself and invoke a command that destroys it.
Our ssh command does just that, and we use the ConnectTimeout and ServerAliveInterval options to ensure that our connection doesn't get stuck because we terminate the VIP while still connected to it. The reason for specifying StrictHostKeyChecking and UserKnownHostsFile is less obvious. We do this because the VIP is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access