Web App Failover problem
Hi,
I have successfully set-up a DB mirroring. When the pricipal goes down, the mirror picksup and the other way around too. So the mirroring part is working great. However, when I use my web applicaiton (dot net 2.0), it isnot able to connect to Mirror server. I get the following error:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
My connection string in web app:
"Server=serverAAA;Failover Partner=serverBBB;Database=TestDB;User Id=testUser;Password=testPassword;"
I have checked the surface are config on "serverBBB" and it is set to use tcpip only for remote connections.
Any suggestions are higly appreciated. TIA.
[990 byte] By [
exBK] at [2008-3-7]
1. You should allow local and remote connections for TCPIP as well as Named Pipes on the mirror. Use Surface Area Configuration for this.
2. It appears from your post that your application is successfully able to connect to the server serverAAA. The first thing to do would be to compare the connection settings on serverAAA and serverBBB. It should work if the settings are the same on both the partner servers.
Thanks for your suggestions. I am not sure what you mean by
"The first thing to do would be to compare the connection settings on serverAAA and serverBBB"
What exactly do I need to compare? Thanks for your time.
Hi!
I've seen this message often enough. You use sql authentication in your connection string what doesn't work.
One problem is that the dbuser what you use to connect to the principal db will become an orphaned user on the mirror. To check this, iniitiate a failover, delete and recreate the database user on the (new) principal and try to connect with the application.
Here is an interesting discussion about this and "high availibility":
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=433672&SiteID=1
By the way, i use integrated security to connect the application to the db now, and it works fine...
Greetings, Torsten
Hi all
I have almost same problem, following exBK link I've installed the .NET framework 2.0 fix.
I'm using a principal and a mirror database with both SQL2005 SP1, and a witness with SQLEXPRESS SP1 (high safety with automatic failover).
I'm using certificates, because I'm not on a domain.
After some tests I found that
- if my application (windows) is started from zero then everything is going very well, ne error messages.
- If I run a command from inside my application then it takes 30 secs (and after I get the timeout error) to switch to the failover partner.
Actually I haven't found any solution to this,any suggestion is greatly appreciated!!
Thanks