For example:
Abridged output of netstat on the primary (on 192.168.1.10):
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN - Listening on all interfaces at port 3306
tcp 0 0 192.168.1.10:3306 192.168.1.10:53540 ESTABLISHED - Local GW connecting to a local DB. 192.168.1.10 is using 192.168.1.10 as the active DB
tcp 0 0 192.168.1.10:3306 192.168.1.20:42631 ESTABLISHED - Remote connecting to a local DB. 192.168.1.20 is using 192.168.1.10 as the active DB
tcp 0 0 192.168.1.10:31722 192.168.1.10:3307 ESTABLISHED - Local GW connecting to a remote DB for replication.
Abridged output of netstat on the secondary (on 192.168.1.20):
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN - Listening on all interfaces at port 3306
tcp 0 0 192.168.1.20:20613 192.168.1.10:3306 ESTABLISHED - Local GW connecting to a remote DB. 192.168.1.20 is using 192.168.1.10 as the active DB
tcp 0 0 192.168.1.20:42631 192.168.1.10:3306 ESTABLISHED - Local GW connecting to a remote DB. 192.168.1.20 is using 192.168.1.10 as the active DB
tcp 0 0 192.168.1.10:3307 192.168.1.10:16249 ESTABLISHED - Remote GW connecting to local DB for replication.
To summarize: Look at the TCP connections for port 3306 on a Gateway appliance. A majority (if not all of them, outright) will be connected to whichever database host is considered "active" (regardless of primary or secondary status).
Original Message:
Sent: 10-02-2019 07:18 AM
From: Marko Todoric
Subject: CA db failover question
Hi,
How we can check to which mysql node gw is connected to ?
We have situation in which vmware with mysql went down, and we would like to check did gw switched to "Secondary" db?
What happens once it become available agai ? Will it switch back to "Primary" or stayed connected to "Secundary" ?
Kr
Marko