You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24,18 +24,45 @@ Azure failover groups use the same distributed availability groups technology th
24
24
> - The Azure Arc-enabled SQL Managed Instance in both geo-primary and geo-secondary sites need to be identical in terms of their compute & capacity, as well as service tiers they are deployed in.
25
25
> - Distributed availability groups can be setup for either General Purpose or Business Critical service tiers.
26
26
27
-
To configure an Azure failover group:
27
+
## Prerequisites
28
28
29
+
The following prerequisites must be met before setting up Azure Failover groups between two Arc enabled SQL managed instances:
30
+
1. An Azure Arc data controller and an Arc enabled SQL managed instance provisioned at the primary site with `--license-type` as one of ` BasePrice` or `LicenseIncluded`.
31
+
2. An Azure Arc data controller and an Arc enabled SQL managed instance provisioned at the secondary site with identical configuration as the primary in terms of CPU, memory, storage, Service tier etc. AND `--license-type` as `DisasterRecovery`
32
+
33
+
34
+
## Deployment process
35
+
Setting up Azure failover group between two Arc enabled SQL managed instances involves the following steps:
29
36
1. Create custom resource for distributed availability group at the primary site
30
37
1. Create custom resource for distributed availability group at the secondary site
31
-
1. Copy the binary data from the mirroring certificates
38
+
1. Copy the binary data from the mirroring certificates
32
39
1. Set up the distributed availability group between the primary and secondary sites
40
+
either in `sync` mode or `async` mode
33
41
34
42
The following image shows a properly configured distributed availability group:
Failover groups in Arc data services supports two synchronization modes - `sync` and `async` and directly impacts how the data is synchronized between the Arc enabled SQL managed instances, and potentially the performance on the primary Arc SQL managed instance.
48
+
49
+
If primary and secondary sites are within a few miles of each other, `sync` mode could be configured. Otherwise `async` is recommended to avoid any performance impact on the Arc SQL managed instance at the primary site.
50
+
51
+
52
+
## Configure Azure failover group - direct mode
53
+
Follow the steps below if the Arc data services was deployed in `directly` connected mode.
54
+
Once the prerequisites are met, run the below command to setup Azure failover group between the two Arc enabled SQL managed instances:
The above command will create the required custom resources on both primary and secondary sites, and copy the mirroring certificates and configures the failover group between the instances.
61
+
62
+
63
+
## Configure Azure failover group - Indirect mode
64
+
65
+
Follow the steps below if the Arc data services was deployed in `indirectly` connected mode.
39
66
40
67
1. Provision the managed instance in the primary site.
41
68
@@ -115,9 +142,54 @@ The following image shows a properly configured distributed availability group:
## Manual failover from primary to secondary instance
145
+
## Retrieve Azure failover group health state
146
+
147
+
Information about the failover group such as primary role, secondary role, and the current health status can be viewed on the custom resource on either primary or secondary site.
148
+
149
+
Run the below command on primary and/or the secondary site to list the failover groups custom resource:
150
+
151
+
```azurecli
152
+
kubectl get fog -n <namespace>
153
+
```
154
+
155
+
Describe the custom resource to retrieve the failover group status, as follows:
156
+
157
+
```azurecli
158
+
kubectl describe fog <fog cr name> -n <namespace>
159
+
```
160
+
161
+
## Failover group operations
162
+
163
+
Once the failover groups is setup between two Arc enabled SQL managed instances, different failover operations can be performed depending on the circumstances.
164
+
165
+
Possible failover scenarios are:
166
+
1. The Arc SQL managed instances at both sites are in healthy state and a failover needs to be performed:
167
+
+ perform a manual failover from primary to secondary without data loss by setting `role=secondary` on the primary SQL MI.
168
+
169
+
2. Primary site is unhealthy/unreachable and a failover needs to be performed:
170
+
171
+
+ the primary Arc SQL managed instance is down/unhealthy/unreachable
172
+
+ the secondary Arc SQL managed instance needs to be force-promoted to primary with potential data loss
173
+
+ when the original primary Arc SQL managed instance comes back online, it will report as `Primary` role and unhealthy state and needs to be forced into a `secondary` role so it can join the failover group and data can be synchronized.
174
+
175
+
176
+
## Manual failover (without data loss)
177
+
178
+
Use `az sql instance-failover-group-arc update ...` command group to initiate a failover from primary to secondary. Any pending transactions on the geo-primary instance are replicated over to the geo-secondary instance before the failover.
119
179
120
-
Use `az sql instance-failover-group-arc ...` to initiate a failover from primary to secondary. The following command initiates a failover from the primary instance to the secondary instance. Any pending transactions on the geo-primary instance are replicated over to the geo-secondary instance before the failover.
180
+
### Directly connected mode
181
+
Run the following command to initiate a manual failover, in `direct` connected mode using ARM APIs:
182
+
183
+
```azurecli
184
+
az sql instance-failover-group-arc update --name <shared name of DAG> --mi <primary Arc SQL MI> --role secondary --resource-group <resource group>
In the circumstance when the geo-primary instance becomes unavailable, the following commands can be run on the geo-secondary DR instance to promote to primary with a forced failover incurring potential data loss.
135
207
136
-
Run the below command on geo-primary, if available:
208
+
On the geo-secondary DR instance, run the following command to promote it to primary role, with data loss.
209
+
210
+
> [!NOTE]
211
+
> If the `--partner-sync-mode` was configured as `sync`, it needs to be reset to `async` when the secondary is promoted to primary.
212
+
213
+
### Directly connected mode
214
+
```azurecli
215
+
az sql instance-failover-group-arc update --name <shared name of DAG> --mi <secondary Arc SQL MI> --role force-primary-allow-data-loss --resource-group <resource group> --partner-sync-mode async
az sql instance-failover-group-arc update --name <shared name of DAG> --mi <old primary Arc SQL MI> --role force-secondary --resource-group <resource group>
146
233
```
147
-
## Limitation
148
234
149
-
When you use [SQL Server Management Studio Object Explorer to create a database](/sql/relational-databases/databases/create-a-database#SSMSProcedure), the application returns an error. You can [create new databases with T-SQL](/sql/relational-databases/databases/create-a-database#TsqlProcedure).
Optionally, the `--partner-sync-mode` can be configured back to `sync` mode if desired.
240
+
241
+
At this point, if you plan to continue running the production workload off of the secondary site, the `--license-type` needs to be updated to either `BasePrice` or `LicenseIncluded` to initiate billing for the vcores consumed.
0 commit comments