question

NoelMcGrath-0184 avatar image
0 Votes"
NoelMcGrath-0184 asked Criszhan-msft edited

SqlServer mirroring failover on fargate

We have a simple .NET 5 console app deployed in a Docker container. The app connects to SQL Server and does a simple SELECT * periodically (via Microsoft.Data.SqlClient.dll). The app is deployed in a cluster on Fargate (ECS). SQL Server is a mirrored setup, configured for automatic failover.

When we perform a manual failover of the database, a connection cannot be established to the database failover partner for some reason, and the application throws exceptions (System.Exception Cannot connect to SQL Server Browser. Ensure SQL Server Browser has been started). We have verified that SQL Server Browser is started, and all necessary protocols/ports are opened to allow network traffic to and from the database.

We have tried running this app/Docker container on an Amazon Linux 2 EC2 instance (which we assume is the underlying EC2 instance on top of which Fargate tasks run), and we have observed the same behaviour. However, we have also tried running this app/Docker container on a Ubuntu 18.04 EC2 instance, and we do not observe any errors - the app instantly connects to the database failover partner following a manual failover. Thus this appears to possibly be an issue with the underlying host OS.

Any help with this would be greatly appreciated.

sql-server-generaldotnet-csharpdotnet-sqlclient
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Criszhan-msft avatar image
0 Votes"
Criszhan-msft answered Criszhan-msft edited

Hi,
Welcome to Microsoft Q&A!

May I know the connection string used to connect SQL Server?
Please show the complete error message received when the connection fails.

However, we have also tried running this app/Docker container on a Ubuntu 18.04 EC2 instance, and we do not observe any errors

Since the failover partner can be successfully connected in this environment, this may not be a problem from the SQL Server side.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.