THE SQL Server Blog Spot on the Web
Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

Adam Machanic

Adam Machanic, Boston-based independent database consultant, writer, and speaker, shares his experiences with programming, performance tuning, and optimizing SQL Server 2000, 2005, and 2008, in conjunction with related technologies such as .NET.

Database Mirroring: FQDNs are Your Friends!

On a recent project for a customer, I learned an imporant Database Mirroring lesson: fully-qualified domain names (FQDNs) are essential!

Both Books Online and the mirroring wizard indicate that it's OK to specify the participating servers as IP addresses--so that's what I did.  The witness came up fine, and the principal came up fine.  Mirroring started, and I did a few manual failovers.  Great!

But now I added the witness server and suddenly things started breaking down. The mirror instance couldn't connect with the witness, and the witness was throwing strange errors like:

Database mirroring connection error 4 'An error occurred while receiving data: '64(The specified network name is no longer available.)'.' for 'TCP://Server2:7024'.

...where "Server2" in this example is the mirror. Notice that the error doesn't include the IP address, but rather the server's name?

After banging my head against the table for a day or so, I wrote to about 50 people asking for help. No answers, and I thought I was out of luck until Don Vilen was kind enough to reply. Turns out, the problem is simple to fix: Don't use IP addresses, ever.  Always use FQDNs!  Thanks, Don!!  Once the FQDNs were used, instead of the IP addresses, everything came up as expected and automatic failovers started working perfectly.

To find your server's FQDN, you can use "ipconfig" from the command prompt, and append the server name to the connection-specific DNS suffix. 

I hope this post helps someone else avoid the frustration I went through. It was a rough couple of days trying to debug this problem and having to tell a customer that their planned HA solution might not work is not a fun situation to be in.


Published Wednesday, June 13, 2007 9:09 PM by Adam Machanic
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

roman said:

good timing, I am about to start on a DB mirroring implementation

June 14, 2007 9:30 AM
 

High Availability (SSQA) said:

Cross posted from : Adam Machanic SQLBlog that helped me to resolve one issue during a DB mIrroring issue

June 16, 2007 2:31 PM

Leave a Comment

(required) 
(optional)
(required) 
Submit

About Adam Machanic

Adam Machanic is a Boston-based independent database consultant, writer, and speaker. He has been involved in dozens of SQL Server implementations for both high-availability OLTP and large-scale data warehouse applications, and has optimized data access layer performance for several data-intensive applications. Adam has written for numerous web sites and magazines, including SQLblog, Simple Talk, Search SQL Server, SQL Server Professional, CoDe, and VSJ. He has also contributed to several books on SQL Server, including "Expert SQL Server 2005 Development" (Apress, 2007) and "Inside SQL Server 2005: Query Tuning and Optimization" (Microsoft Press, 2007). Adam regularly speaks at user groups, community events, and conferences on a variety of SQL Server and .NET-related topics. He is a Microsoft Most Valuable Professional (MVP) for SQL Server and a Microsoft Certified IT Professional (MCITP).

This Blog

Syndication

News

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement