SQL Azure的连接字符串与Geo-Replica

发布于 2025-02-09 20:01:22 字数 435 浏览 0 评论 0 原文

借助仅阅读路由,我们可以让一个故障转移组侦听器将连接直接直接读取到只读的辅助工具,从而可以提供额外的容量。

我已经设置了此设置,但我对FG为连接提供了两种不同的FQDN感到困惑,一个是 servername.database.windows.net.net and other servername.seconverame.database .windows.net 。当系统启动和运行时,这些工作是按预期的,但是尚不清楚的是,如果主脱机并发生故障转移,则次要连接会发生什么。辅助连接是否会自动路由到新的主服务器/唯一的服务器,或者因为没有可用的辅助服务而停止工作?

我会测试它,但是我找不到一种方法来模拟次级离线的方法。

或者。当我尝试使用 applicationintent = ReadOnly 使用主连接时,似乎将所有流量发送到主服务器,以免工作。

With read-only routing, we can have a Failover Group listener direct the connection to a read-only secondary automatically, which can provide additional capacity.

I have set this up but I am confused about the fact that the FG provides two different FQDNs for the connection, one is servername.database.windows.net and the other servername.secondary.database.windows.net. These work as expected when the system is up and running but what is not clear is what happens to the secondary connection if the primary goes offline and a failover takes place. Would the secondary connection automatically route to the new primary/only server or would it simply stop working because there would be no secondaries available?

I would test it but I can't find a way to take the secondary offline to simulate it being unavailable.

Alternatively. when I tried using the primary connection with ApplicationIntent=ReadOnly, it seems it sends all traffic to the primary server so that doesn't work either.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

行至春深 2025-02-16 20:01:22

如果主脱机并发生故障转移,次级连接会发生什么?

自动防止小组提供读写和仅阅读的听众终点,这些端点在地理上不变的过程中保持不变。这意味着您不必在地理失效之后更改应用程序的连接字符串,因为连接会自动路由到当前主要主管。无论您是使用手册还是自动故障转移激活,地理上禁止将组中的所有次要数据库切换为主要角色。

它会只是因为没有可用的辅助工具而停止工作吗?

  1. 如果将单个数据库添加到故障转移组,则它将使用同一版本和计算辅助服务器上的大小自动创建辅助数据库。
  2. 如果添加了辅助服务器中已经具有辅助数据库的数据库,则该组由组继承了地理复制链接。
  3. 当添加一个数据库,该数据库已经在不属于故障转移组的服务器中具有辅助数据库时,在辅助服务器中创建了一个新的辅助。

请参阅: auto-failover组概述&最佳实践

what happens to the secondary connection if the primary goes offline and a failover takes place?

Auto-failover groups provide read-write and read-only listener end-points that remain unchanged during geo-failovers. This means you do not have to change the connection string for your application after a geo-failover, because connections are automatically routed to the current primary. Whether you use manual or automatic failover activation, a geo-failover switches all secondary databases in the group to the primary role.

would it simply stop working because there would be no secondaries available?

  1. If you add a single database to the failover group, it automatically creates a secondary database using the same edition and compute size on secondary server.
  2. If you add a database that already has a secondary database in the secondary server, that geo-replication link is inherited by the group.
  3. When you add a database that already has a secondary database in a server that is not part of the failover group, a new secondary is created in the secondary server.

Refer: Auto-failover groups overview & best practices

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文