Skip to content

Commit 902061c

Browse files
author
Mike Ray (Microsoft)
committed
Update managed instance disaster recovery.
1 parent d657767 commit 902061c

File tree

1 file changed

+49
-35
lines changed

1 file changed

+49
-35
lines changed

articles/azure-arc/data/managed-instance-disaster-recovery.md

Lines changed: 49 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,29 @@ Azure failover groups use the same distributed availability groups technology th
2222

2323
> [!NOTE]
2424
> - 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.
2626
2727
## Prerequisites
2828

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`
3240

3341
> [!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.
3543
3644
## 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+
3848
1. Create custom resource for distributed availability group at the primary site
3949
1. Create custom resource for distributed availability group at the secondary site
4050
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
4353

4454
The following image shows a properly configured distributed availability group:
4555

46-
![A properly configured distributed availability group](.\media\business-continuity\dag.png)
56+
![A properly configured distributed availability group](.\media\business-continuity\distributed-availability-group.png)
4757

4858
## Synchronization modes
49-
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.
5059

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.
5261

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.
5363

5464
## 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:
5769

5870
```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>
6072
```
73+
6174
Example:
75+
6276
```azurecli
6377
az sql instance-failover-group-arc create --name sql-fog --mi sql1 --partner-mi sql2 --resource-group rg-name --partner-resource-group rg-name
6478
```
6579

66-
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.
6881

6982
## Configure Azure failover group - Indirect mode
7083

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.
7285

7386
1. Provision the managed instance in the primary site.
7487

@@ -79,21 +92,21 @@ Follow the steps below if the Arc data services was deployed in `indirectly` con
7992
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.
8093

8194
> [!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.
8396
8497

8598

8699
```azurecli
87100
az sql mi-arc create --name <secondaryinstance> --tier bc --replicas 3 --license-type DisasterRecovery --k8s-namespace <namespace> --use-k8s
88101
```
89102

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.
91104

92105
This can be achieved in a few ways:
93106

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.
95108

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.
97110

98111

99112
Using (a) above:
@@ -129,18 +142,18 @@ Follow the steps below if the Arc data services was deployed in `indirectly` con
129142
> Ensure the SQL instances have different names for both primary and secondary sites, and the `shared-name` value should be identical on both sites.
130143
131144
```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
133146
```
134147
135148
Example:
136149
```azurecli
137150
az sql instance-failover-group-arc create --shared-name myfog --name primarycr --mi sqlinstance1 --role primary --partner-mi sqlinstance2 --partner-mirroring-url tcp://10.20.5.20:970 --partner-mirroring-cert-file $HOME/sqlcerts/sqlinstance2.pem --k8s-namespace my-namespace --use-k8s
138151
```
139152
140-
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.
141154
142155
```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
144157
```
145158
146159
Example:
@@ -161,22 +174,23 @@ kubectl get fog -n <namespace>
161174
Describe the custom resource to retrieve the failover group status, as follows:
162175

163176
```azurecli
164-
kubectl describe fog <fog cr name> -n <namespace>
177+
kubectl describe fog <failover group cr name> -n <namespace>
165178
```
166179

167180
## Failover group operations
168181

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.
170183

171184
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:
173187
+ perform a manual failover from primary to secondary without data loss by setting `role=secondary` on the primary SQL MI.
174188

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:
176190

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.
180194

181195

182196
## Manual failover (without data loss)
@@ -187,7 +201,7 @@ Use `az sql instance-failover-group-arc update ...` command group to initiate a
187201
Run the following command to initiate a manual failover, in `direct` connected mode using ARM APIs:
188202

189203
```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>
191205
```
192206
Example:
193207

@@ -198,7 +212,7 @@ az sql instance-failover-group-arc update --name myfog --mi sqlmi1 --role second
198212
Run the following command to initiate a manual failover, in `indirect` connected mode using kubernetes APIs:
199213

200214
```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
202216
```
203217

204218
Example:
@@ -218,7 +232,7 @@ On the geo-secondary DR instance, run the following command to promote it to pri
218232
219233
### Directly connected mode
220234
```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
222236
```
223237
Example:
224238

@@ -231,11 +245,11 @@ az sql instance-failover-group-arc update --name myfog --mi sqlmi2 --role force-
231245
az sql instance-failover-group-arc update --k8s-namespace my-namespace --name secondarycr --use-k8s --role force-primary-allow-data-loss --partner-sync-mode async
232246
```
233247

234-
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:
235249

236250
### Directly connected mode
237251
```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>
239253
```
240254

241255
### Indirectly connected mode
@@ -244,7 +258,7 @@ az sql instance-failover-group-arc update --k8s-namespace my-namespace --name se
244258
```
245259
Optionally, the `--partner-sync-mode` can be configured back to `sync` mode if desired.
246260

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.
248262

249263

250264

0 commit comments

Comments
 (0)