Hi Lewei,
I have followed this document and setup multiple-subnet failover cluster in AWS.
I have Primary Server in Subnet1 and Secondary server in Subnet 2. I have configured CIB files as per your article.
configured 2 DNS entries for aglistener.
while testing failover, when I shutdown primary, secondary becomes master, and when I connect from SQL Server Management Studio(SSMS) to aglistener, I connect to Secondary.
but when I manually move the resource from primary to secondary using command "pcs resource move" resource moves successfully to secondary, "pcs resource" output shows vip1 started on red2 and red2 is master and red1 is slave
however 192.168.2.111 on red1 still listens on port 1433, so when I connect from SSMS to aglistener, it connects to red1 even though red2 is master.
But if I move resource back to red1 and red1 becomes master and red2 is slave, 192.168.4.111 doesn't respond to 1433, so when I connect via SSMS to aglistener I connect to red1, which is correct behavior.
so basically issues in my case is VIP on red1 is always listening on 1433 even when red1 is not master, I even tried "pcs resource disable vip1" when red1 is master, and red1 still responds to 1433.
Please suggest what am I missing.