Our environment does not have DNS- so mirroring is configured as how we setup for different domains. Mirroring is functioning as expected and manual/automatic failover is also working for all databases. Issue is the websites/applications are not functioning as expected when database failover to MirrorSQL server.
On webserver the hostfile is mentioned as
10.11.500.600 - MirrorSQL
On DB server the hostfile is mentioned as
Actual Primary DB instance name is AMAXXXYYYDS01
Actual Mirror DB instance name is AMAXXXYYYDS02
In the mirorring configuration properties the server network address is mentioned as below:
Mirror - TCP:// AMAXXXYYYDS02:5022
Witness- TCP:// AMAXXXYYYDS03:5022
so does the host file in webservers should be as what we have or is it should be the actual name of the server? and what is the difference or is this the issue for sites not functioning?
Our connection string is like this:
Server=PrimarySQL;Failover Partner=MirrorSQL;Initial Catalog=myDataBase;UserID=myUsername;Password=myPassword;Network Library=DBMSSOCN;
From this link
“When a SqlConnection is successfully opened, the failover partner name is returned by the server and supersedes any values supplied in the connection string.”
Is this is the issue ? why our websites were not able to connect to the MirrorDB server after failover.
Based on above link it seems like when failover happens- Sqlconnection was looking for "AMAXXXYYYDS02"instance name and which is not mentioned in webserver host file.
Can some one please provide your opinion on this issue?