SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Database mirroring failover using hostfile


Database mirroring failover using hostfile

Author
Message
muth_51
muth_51
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2483 Visits: 2928
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?
Satish Nagaraja
Satish Nagaraja
SSChasing Mays
SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)

Group: General Forum Members
Points: 618 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.

Cheers
Sat

Cheer Satish :-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search