Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Database mirroring failover using hostfile Expand / Collapse
Author
Message
Posted Wednesday, June 4, 2014 1:52 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 12:34 PM
Points: 388, Visits: 1,905
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
10.11.100.200- PrimarySQL
10.11.500.600 - MirrorSQL

On DB server the hostfile is mentioned as

10.11.100.200- AMAXXXYYYDS01
10.11.500.600-AMAXXXYYYDS02

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
http://msdn.microsoft.com/en-us/library/vstudio/5h52hef8(v=vs.100).aspx


“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
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, July 25, 2014 4:40 AM
Points: 166, Visits: 267
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.

Cheers
Sat


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

Add to briefcase

Permissions Expand / Collapse