Author |
Topic |
gazat2e2
Starting Member
5 Posts |
Posted - 2008-10-01 : 08:23:12
|
Hi,I have set up a SQL mirror with a witness for a client on SQL 2005. The SQL machines reside on a domain and work correctly. The web applications that call SQL, however, reside on a DMZ in a workgroup. I have a test application which works perfectly when ran on a domain machine, however, if I run the application on a web server, I get strange results. The application works until I fail over the database (which fails over correctly) - at which point I get a client login error and the application breaks. If I rebuild the application, it works again, using the mirror. If I now fail it back over to the original prinicple, the application continues to work correctly. Failing over again causes the application to break again. The behaviour seems consistant in which way it works or doesnot.Very strange - any help would be greatly appreciated.ThanksGareth |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-10-01 : 11:17:42
|
You should setup Failover Partner in your connection strings .Look at Microsoft whitepaper on Application Failover in DB mirroring. |
|
|
gazat2e2
Starting Member
5 Posts |
Posted - 2008-10-01 : 15:05:37
|
Hi Sodeep,I have added the failover partner in the connection string, just as I would do normally. As I mentioned, the strange thing is, the application works perfectly when the calling web server is on the domain, just not when on a workgroup. |
|
|
Mike2008
Starting Member
11 Posts |
Posted - 2008-10-15 : 14:16:55
|
The problem with mirroring is that the system databases, which contains the user and password for example, are not (and cannot) be mirrored. Therefore the database won't be associated with a user once it fails over.You will have to use certificates in order to make it work in a workgroup environment .. http://alan328.com/SQL2005_Database_Mirroring_Tutorial.aspx |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
gazat2e2
Starting Member
5 Posts |
Posted - 2008-10-15 : 14:46:53
|
I appreciate your responses and you may be on to something. I do currently, however, copy the usernames, passwords and SIDs on to the Primary and Mirror server. I don't believe I have copied them on to the Witness - I wonder if this could be the issue.Another area I am exploring is if the fact that the web servers in the DMZ do not run NetBios.Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
gazat2e2
Starting Member
5 Posts |
Posted - 2008-10-15 : 15:19:27
|
Thanks - great to know I hadn't made a mistake by not putting them on the witness.I do not have access to the clients' machines at the moment, but I do know that the test web application I created reported that it could not connect to the database, once it was failed over - almost like it didnot know there was a witness. '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) ' I will try to get them to give me a more accurate report back. As I mentioned, the wierd thing is, exactly the same code worked perfectly when ran on a web server that was on the domain.Thanks again |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
gazat2e2
Starting Member
5 Posts |
Posted - 2008-10-15 : 16:00:47
|
Cool - so I could be on the right lines with this being a Netbios issue. Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|