Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Database mirroring failover using hostfile Expand / Collapse
Posted Wednesday, June 4, 2014 1:52 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, November 17, 2016 1:50 PM
Points: 500, Visits: 2,858
HI All,

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 PrimarySQL
10.11.500.600 - MirrorSQL

On DB server the hostfile is mentioned as AMAXXXYYYDS01

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:
Principal -tcp://AMAXXXYYYDS01:5022
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?
Post #1577524
Posted Tuesday, June 10, 2014 3:17 AM


Group: General Forum Members
Last Login: Friday, April 15, 2016 1:55 AM
Points: 172, Visits: 308
Is the webserver able to connect to two instances using telnet test ?

Also check using ODBC test if you can communicate from webserver to primary & secondary server's.

If the above is working properly then only you application's can reach your mirror server.


Cheer Satish
Post #1579092
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse