[英]Azure SQL failover group, what does the grace period mean?
我目前正在閱讀: https://docs.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 分鍾。
這是什么意思? 我在任何地方都找不到明確的答案。 是否意味着:
我認為這歸結為:如果我檢測到中斷,如果我不關心數據丟失,但我希望能夠寫入我的數據庫,我是否必須手動進行故障轉移?
額外問題:存在寬限期的原因是因為主節點上可能存在未同步的數據,如果輔助節點成為新的主節點(如果我手動切換),這些數據將被覆蓋或丟棄?
抱歉,我不能只回答一個問題。 我已經閱讀了很多,我真的需要知道這一點。
這是什么意思?
這意味着:
“當我的主要數據庫所在的主要區域發生中斷時,讀/寫端點指向主要數據庫,並且僅在 60 分鍾后它才會故障轉移到我的輔助數據庫,后者成為新的主要數據庫。”
即使數據同步,它也無法自動進行故障轉移,因為主區域中的高可用性解決方案正在嘗試做同樣的事情,並且幾乎所有時間您的主數據庫都會在主區域中快速恢復。 執行自動跨區域故障轉移會干擾這一點。
和
“存在寬限期的原因是因為主節點上可能存在未同步的數據,如果輔助節點成為新的主節點,這些數據將被覆蓋或丟棄”
並留出時間讓數據庫在主要區域內進行故障轉移。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.