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
Copy file name to clipboardExpand all lines: articles/azure-arc/data/managed-instance-disaster-recovery.md
+49-35Lines changed: 49 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,19 +22,29 @@ Azure failover groups use the same distributed availability groups technology th
22
22
23
23
> [!NOTE]
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
-
> - Distributed availability groups can be setup for either General Purpose or Business Critical service tiers.
25
+
> - Distributed availability groups can be set up for either General Purpose or Business Critical service tiers.
26
26
27
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, collation etc. AND `--license-type` as `DisasterRecovery`
29
+
The following prerequisites must be met before setting up failover groups between two Azure Arc-enabled SQL managed instances:
30
+
31
+
- 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`.
32
+
- 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:
33
+
- CPU
34
+
- Memory
35
+
- Storage
36
+
- Service tier
37
+
- Collation
38
+
- Other instance settings
39
+
- The instance at the secondary type requires `--license-type` as `DisasterRecovery`
32
40
33
41
> [!NOTE]
34
-
> - It is important to specify the `--license-type`**during** the Azure Arc SQL MI creation. This will allow the DR instance to be seeded from the primary instance in the primary data center. Updating this property post deployment will not have the same effect.
42
+
> - It is important to specify the `--license-type`**during** the Azure Arc-enabled SQL MI creation. This will allow the DR instance to be seeded from the primary instance in the primary data center. Updating this property post deployment will not have the same effect.
35
43
36
44
## Deployment process
37
-
Setting up an Azure failover group between two Arc enabled SQL managed instances involves the following steps:
45
+
46
+
To set up an Azure failover group between two Azure Arc-enabled SQL managed instances, complete the following steps:
47
+
38
48
1. Create custom resource for distributed availability group at the primary site
39
49
1. Create custom resource for distributed availability group at the secondary site
40
50
1. Copy the binary data from the mirroring certificates
@@ -43,32 +53,35 @@ Setting up an Azure failover group between two Arc enabled SQL managed instances
43
53
44
54
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.
50
59
51
-
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.
60
+
Failover groups in Azure Arc data services support two synchronization modes - `sync`and `async`. The synchronization mode directly impacts how the data is synchronized between the Azure Arc-enabled SQL managed instances, and potentially the performance on the primary managed instance.
52
61
62
+
If primary and secondary sites are within a few miles of each other, use `sync` mode. Otherwise use `async` mode to avoid any performance impact on the primary site.
53
63
54
64
## Configure Azure failover group - direct mode
55
-
Follow the steps below if the Arc data services was deployed in `directly` connected mode.
56
-
Once the prerequisites are met, run the below command to setup Azure failover group between the two Arc enabled SQL managed instances:
65
+
66
+
Follow the steps below if the Azure Arc Arc data services are deployed in `directly` connected mode.
67
+
68
+
Once the prerequisites are met, run the below command to set up Azure failover group between the two Azure Arc-enabled SQL managed instances:
57
69
58
70
```azurecli
59
-
az sql instance-failover-group-arc create --name <name of FOG> --mi <primary SQL MI> --partner-mi <Partner MI> --resource-group <name of RG> --partner-resource-group <name of partner MI RG>
71
+
az sql instance-failover-group-arc create --name <name of failover group> --mi <primary SQL MI> --partner-mi <Partner MI> --resource-group <name of RG> --partner-resource-group <name of partner MI RG>
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.
67
-
80
+
The above command creates the required custom resources on both primary and secondary sites, and copy the mirroring certificates and configures the failover group between the instances.
68
81
69
82
## Configure Azure failover group - Indirect mode
70
83
71
-
Follow the steps below if the Arc data services was deployed in `indirectly` connected mode.
84
+
Follow the steps below if Azure Arc data services are deployed in `indirectly` connected mode.
72
85
73
86
1. Provision the managed instance in the primary site.
74
87
@@ -79,21 +92,21 @@ Follow the steps below if the Arc data services was deployed in `indirectly` con
79
92
2. Switch context to the secondary cluster by running ```kubectl config use-context <secondarycluster>``` and provision the managed instance in the secondary site that will be the disaster recovery instance. At this point, the system databases are not part of the contained availability group.
80
93
81
94
> [!NOTE]
82
-
> - It is important to specify `--license-type DisasterRecovery`**during** the Azure Arc SQL MI creation. This will allow the DR instance to be seeded from the primary instance in the primary data center. Updating this property post deployment will not have the same effect.
95
+
> - It is important to specify `--license-type DisasterRecovery`**during** the Azure Arc-enabled SQL MI creation. This will allow the DR instance to be seeded from the primary instance in the primary data center. Updating this property post deployment will not have the same effect.
83
96
84
97
85
98
86
99
```azurecli
87
100
az sql mi-arc create --name <secondaryinstance> --tier bc --replicas 3 --license-type DisasterRecovery --k8s-namespace <namespace> --use-k8s
88
101
```
89
102
90
-
3. Mirroring certificates - The binary data inside the Mirroring Certificate property of the Arc SQL MI is needed for the Instance Failover Group CR (Custom Resource) creation.
103
+
3. Mirroring certificates - The binary data inside the Mirroring Certificate property of the Azure Arc-enabled SQL MI is needed for the Instance Failover Group CR (Custom Resource) creation.
91
104
92
105
This can be achieved in a few ways:
93
106
94
-
(a) If using ```az``` CLI, generate the mirroring certificate file first, and then point to that file while configuring the Instance Failover Group so the binary data is read from the file and copied over into the CR. The cert files are not needed post FOG creation.
107
+
(a) If using `az` CLI, generate the mirroring certificate file first, and then point to that file while configuring the Instance Failover Group so the binary data is read from the file and copied over into the CR. The cert files are not needed after failover group creation.
95
108
96
-
(b) If using ```kubectl```, directly copy and paste the binary data from the Arc SQL MI CR into the yaml file that will be used to create the Instance Failover Group.
109
+
(b) If using `kubectl`, directly copy and paste the binary data from the Azure Arc-enabled SQL MI CR into the yaml file that will be used to create the Instance Failover Group.
97
110
98
111
99
112
Using (a) above:
@@ -129,18 +142,18 @@ Follow the steps below if the Arc data services was deployed in `indirectly` con
129
142
> Ensure the SQL instances have different names for both primary and secondary sites, and the `shared-name` value should be identical on both sites.
130
143
131
144
```azurecli
132
-
az sql instance-failover-group-arc create --shared-name <name of failover group> --name <name for primary FOG resource> --mi <local SQL managed instance name> --role primary --partner-mi <partner SQL managed instance name> --partner-mirroring-url tcp://<secondary IP> --partner-mirroring-cert-file <secondary.pem> --k8s-namespace <namespace> --use-k8s
145
+
az sql instance-failover-group-arc create --shared-name <name of failover group> --name <name for primary failover group resource> --mi <local SQL managed instance name> --role primary --partner-mi <partner SQL managed instance name> --partner-mirroring-url tcp://<secondary IP> --partner-mirroring-cert-file <secondary.pem> --k8s-namespace <namespace> --use-k8s
On the secondary instance, run the following command to setup the FOG CR. The ```--partner-mirroring-cert-file``` in this case should point to a path that has the mirroring certificate file generated from the primary instance as described in 3(a) above.
153
+
On the secondary instance, run the following command to set up the failover group custom resource. The `--partner-mirroring-cert-file` in this case should point to a path that has the mirroring certificate file generated from the primary instance as described in 3(a) above.
141
154
142
155
```azurecli
143
-
az sql instance-failover-group-arc create --shared-name <name of failover group> --name <name for secondary FOG resource> --mi <local SQL managed instance name> --role secondary --partner-mi <partner SQL managed instance name> --partner-mirroring-url tcp://<primary IP> --partner-mirroring-cert-file <primary.pem> --k8s-namespace <namespace> --use-k8s
156
+
az sql instance-failover-group-arc create --shared-name <name of failover group> --name <name for secondary failover group resource> --mi <local SQL managed instance name> --role secondary --partner-mi <partner SQL managed instance name> --partner-mirroring-url tcp://<primary IP> --partner-mirroring-cert-file <primary.pem> --k8s-namespace <namespace> --use-k8s
144
157
```
145
158
146
159
Example:
@@ -161,22 +174,23 @@ kubectl get fog -n <namespace>
161
174
Describe the custom resource to retrieve the failover group status, as follows:
162
175
163
176
```azurecli
164
-
kubectl describe fog <fog cr name> -n <namespace>
177
+
kubectl describe fog <failover group cr name> -n <namespace>
165
178
```
166
179
167
180
## Failover group operations
168
181
169
-
Once the failover groups is setup between two Arc enabled SQL managed instances, different failover operations can be performed depending on the circumstances.
182
+
Once the failover groups is set up between the managed instances, different failover operations can be performed depending on the circumstances.
170
183
171
184
Possible failover scenarios are:
172
-
1. The Arc SQL managed instances at both sites are in healthy state and a failover needs to be performed:
185
+
186
+
- The Azure Arc-enabled SQL managed instances at both sites are in healthy state and a failover needs to be performed:
173
187
+ perform a manual failover from primary to secondary without data loss by setting `role=secondary` on the primary SQL MI.
174
188
175
-
2. Primary site is unhealthy/unreachable and a failover needs to be performed:
189
+
- Primary site is unhealthy/unreachable and a failover needs to be performed:
176
190
177
-
+ the primary Arc SQL managed instance is down/unhealthy/unreachable
178
-
+ the secondary Arc SQL managed instance needs to be force-promoted to primary with potential data loss
179
-
+ 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.
191
+
+ the primary Azure Arc-enabled SQL managed instance is down/unhealthy/unreachable
192
+
+ the secondary Azure Arc-enabled SQL managed instance needs to be force-promoted to primary with potential data loss
193
+
+ when the original primary Azure Arc-enabled 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.
180
194
181
195
182
196
## Manual failover (without data loss)
@@ -187,7 +201,7 @@ Use `az sql instance-failover-group-arc update ...` command group to initiate a
187
201
Run the following command to initiate a manual failover, in `direct` connected mode using ARM APIs:
188
202
189
203
```azurecli
190
-
az sql instance-failover-group-arc update --name <shared name of FOG> --mi <primary Arc SQL MI> --role secondary --resource-group <resource group>
204
+
az sql instance-failover-group-arc update --name <shared name of failover group> --mi <primary Azure Arc-enabled SQL MI> --role secondary --resource-group <resource group>
191
205
```
192
206
Example:
193
207
@@ -198,7 +212,7 @@ az sql instance-failover-group-arc update --name myfog --mi sqlmi1 --role second
198
212
Run the following command to initiate a manual failover, in `indirect` connected mode using kubernetes APIs:
199
213
200
214
```azurecli
201
-
az sql instance-failover-group-arc update --name <name of FOG resource> --role secondary --k8s-namespace <namespace> --use-k8s
215
+
az sql instance-failover-group-arc update --name <name of failover group resource> --role secondary --k8s-namespace <namespace> --use-k8s
202
216
```
203
217
204
218
Example:
@@ -218,7 +232,7 @@ On the geo-secondary DR instance, run the following command to promote it to pri
218
232
219
233
### Directly connected mode
220
234
```azurecli
221
-
az sql instance-failover-group-arc update --name <shared name of FOG> --mi <secondary Arc SQL MI> --role force-primary-allow-data-loss --resource-group <resource group> --partner-sync-mode async
235
+
az sql instance-failover-group-arc update --name <shared name of failover group> --mi <secondary Azure Arc-enabled SQL MI> --role force-primary-allow-data-loss --resource-group <resource group> --partner-sync-mode async
When the geo-primary Arc SQL MI instance becomes available, run the below command to bring it into the failover group and synchronize the data:
248
+
When the geo-primary Azure Arc-enabled SQL MI instance becomes available, run the below command to bring it into the failover group and synchronize the data:
235
249
236
250
### Directly connected mode
237
251
```azurecli
238
-
az sql instance-failover-group-arc update --name <shared name of FOG> --mi <old primary Arc SQL MI> --role force-secondary --resource-group <resource group>
252
+
az sql instance-failover-group-arc update --name <shared name of failover group> --mi <old primary Azure Arc-enabled SQL MI> --role force-secondary --resource-group <resource group>
239
253
```
240
254
241
255
### Indirectly connected mode
@@ -244,7 +258,7 @@ az sql instance-failover-group-arc update --k8s-namespace my-namespace --name se
244
258
```
245
259
Optionally, the `--partner-sync-mode` can be configured back to `sync` mode if desired.
246
260
247
-
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.
261
+
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