Skip to content

SQL server Linked server with Multi-AZ

0

Hi team,

We are created Linked server on single-AZ RDS SQL server for Multi-AZ RDS SQL server. the Linked server some times test connection working and some time not working. we used Multi-az DNS name in Likned server script. The DNS name have two IPs, is this creating any issues for Linked server. I have created one test linked server with Multi-az RDS IP address and that is working without any issues. Please let me know , what is issues for this linked server.

We followed this link: https://aws.amazon.com/blogs/database/implement-linked-servers-with-amazon-rds-for-microsoft-sql-server/

Thanks

2 Answers
0

The issue you're experiencing with the linked server connection to your Multi-AZ RDS SQL Server instance is likely related to the use of the DNS name, which resolves to multiple IP addresses in a Multi-AZ setup. While using the DNS name is generally recommended to protect against IP address changes, it can sometimes cause intermittent connectivity issues in linked server configurations.

When you use the Multi-AZ DNS name in your linked server script, SQL Server may attempt to connect to either the primary or secondary instance, depending on how the DNS resolves at that moment. This can lead to inconsistent behavior, where the test connection works sometimes and fails at other times.

The fact that your test linked server using the specific IP address of the Multi-AZ RDS instance works consistently supports this theory. However, it's important to note that using an IP address directly is not recommended for long-term use with RDS instances, as the IP address can change during maintenance events or instance modifications without notice.

To address this issue, you have a few options:

  1. Use the instance-specific endpoint (DNS name) of the primary instance in your Multi-AZ setup for the linked server configuration. This endpoint always points to the current primary instance, even after a failover.

  2. Implement a custom solution that periodically checks and updates the linked server configuration to ensure it's pointing to the current primary instance.

  3. If possible, consider using alternative methods for data access between your SQL Server instances, such as replication or ETL processes, which may be more resilient to Multi-AZ failovers.

It's also worth noting that in a Multi-AZ deployment, linked servers are not automatically replicated to the secondary instance. If you need linked servers on both instances, you'll need to create them manually on the primary, fail over to the secondary, and then create them again on the new primary to ensure they exist on both instances.

Remember to monitor your linked server connections closely and implement appropriate error handling in your applications to manage potential connectivity issues.
Sources
Implement Linked Servers with Amazon RDS for Microsoft SQL Server | AWS Database Blog

answered 2 years ago

0

Can we add the MultiSubnetFailover=Yes in linked server script for RDS.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.