Azure SQL故障转移组,优雅期是什么意思?

6
我正在阅读以下内容:https://learn.microsoft.com/en-us/azure/sql-database/sql-database-auto-failover-group,但是我对自动故障转移政策很难理解:

默认情况下,故障转移组配置了自动故障转移策略。SQL 数据库服务在检测到故障并且优雅期过期后,会触发故障转移。系统必须验证 SQL 数据库服务内置的高可用性基础架构无法通过规模来缓解停机带来的影响。如果您想从应用程序中控制故障转移工作流程,则可以关闭自动故障转移。

在 ARM 模板中定义故障转移组时:

{
  "condition": "[equals(parameters('redundancyId'), 'pri')]",
  "type": "Microsoft.Sql/servers",
  "kind": "v12.0",
  "name": "[variables('sqlServerPrimaryName')]",
  "apiVersion": "2014-04-01-preview",
  "location": "[parameters('location')]",
  "properties": {
    "administratorLogin": "[parameters('sqlServerPrimaryAdminUsername')]",
    "administratorLoginPassword": "[parameters('sqlServerPrimaryAdminPassword')]",
    "version": "12.0"
  },
  "resources": [
    {
      "condition": "[equals(parameters('redundancyId'), 'pri')]",
      "apiVersion": "2015-05-01-preview",
      "type": "failoverGroups",
      "name": "[variables('sqlFailoverGroupName')]",
      "properties": {
        "serverName": "[variables('sqlServerPrimaryName')]",
        "partnerServers": [
          {
            "id": "[resourceId('Microsoft.Sql/servers/', variables('sqlServerSecondaryName'))]"
          }
        ],
        "readWriteEndpoint": {
          "failoverPolicy": "Automatic",
          "failoverWithDataLossGracePeriodMinutes": 60
        },
        "readOnlyEndpoint": {
          "failoverPolicy": "Disabled"
        },
        "databases": [
          "[resourceId('Microsoft.Sql/servers/databases', variables('sqlServerPrimaryName'), variables('sqlDatabaseName'))]"
        ]
      },
      "dependsOn": [
        "[variables('sqlServerPrimaryName')]",
        "[resourceId('Microsoft.Sql/servers/databases', variables('sqlServerPrimaryName'), variables('sqlDatabaseName'))]",
        "[resourceId('Microsoft.Sql/servers', variables('sqlServerSecondaryName'))]"
      ]
    },
    {
      "condition": "[equals(parameters('redundancyId'), 'pri')]",
      "name": "[variables('sqlDatabaseName')]",
      "type": "databases",
      "apiVersion": "2014-04-01-preview",
      "location": "[parameters('location')]",
      "dependsOn": [
        "[variables('sqlServerPrimaryName')]"
      ],
      "properties": {
        "edition": "[variables('sqlDatabaseEdition')]",
        "requestedServiceObjectiveName": "[variables('sqlDatabaseServiceObjective')]"
      }
    }
  ]
},
{
  "condition": "[equals(parameters('redundancyId'), 'pri')]",
  "type": "Microsoft.Sql/servers",
  "kind": "v12.0",
  "name": "[variables('sqlServerSecondaryName')]",
  "apiVersion": "2014-04-01-preview",
  "location": "[variables('sqlServerSecondaryRegion')]",
  "properties": {
    "administratorLogin": "[parameters('sqlServerSecondaryAdminUsername')]",
    "administratorLoginPassword": "[parameters('sqlServerSecondaryAdminPassword')]",
    "version": "12.0"
  }
}

我像这样指定了readWriteEndpoint:

    "readWriteEndpoint": {
      "failoverPolicy": "Automatic",
      "failoverWithDataLossGracePeriodMinutes": 60
    }

将 failoverWithDataLossGracePeriodMinutes 设置为 60 分钟。

这是什么意思?我找不到任何清晰的答案。它是否意味着:

  1. 当我的主要数据库所在的主要区域发生故障时,读写终点指向主要终点,仅在 60 分钟后才故障转移至我的次要终点,成为新的主终点。在 60 分钟内,唯一读取我的数据的方法是直接使用 readOnlyEndpoint 吗?OR
  2. 如果它们能够检测到没有要同步的数据,那么我的读/写终点会立即关闭。

我认为这归结为:如果我不关心数据丢失,但想能够写入数据库,是否必须手动执行故障转移,如果检测到故障的话?

奖励问题:为什么存在宽限期?因为主服务器上可能有未同步的数据,如果次服务器成为新的主服务器(如果我手动切换),则该数据将被覆盖或丢弃吗?

抱歉,我无法只保留一个问题。我已经阅读了很多,我真的需要知道这个。

1个回答

7
这是什么意思?
这意味着:
当我的主数据库所在的主要区域发生故障时,读写端点指向主数据库,并且只有在60分钟后才会故障转移至辅助数据库,它变成新的主数据库。即使数据已同步,也不能自动故障转移,因为主要区域中的高可用性解决方案正在尝试做同样的事情,而大多数情况下,主数据库会很快恢复正常运行。执行跨区域自动故障转移将干扰此过程。
此外,
“宽限期存在的原因是因为主数据库上可能存在未同步的数据,如果辅助数据库成为新的主数据库,则该数据将被覆盖或丢弃。”
并且要允许主数据库在主要区域内进行故障转移的时间。

在停机期间,是否可以建立任何新的连接? - Cocowalla

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接