Skip to content

Commit 1d0d3a1

Browse files
Merge pull request #211270 from MikeRayMSFT/20220914-some-fog
Update managed-instance-disaster-recovery
2 parents cee8799 + ee65556 commit 1d0d3a1

File tree

1 file changed

+46
-20
lines changed

1 file changed

+46
-20
lines changed

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

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,42 @@ ms.custom: event-tier1-build-2022
88
author: dnethi
99
ms.author: dinethi
1010
ms.reviewer: mikeray
11-
ms.date: 04/06/2022
11+
ms.date: 06/13/2022
1212
ms.topic: conceptual
1313
---
1414

1515
# Azure Arc-enabled SQL Managed Instance - disaster recovery
1616

17-
To configure disaster recovery in Azure Arc-enabled SQL Managed Instance, set up failover groups.
17+
To configure disaster recovery in Azure Arc-enabled SQL Managed Instance, set up Azure failover groups.
1818

1919
## Background
2020

21-
The distributed availability groups used in Azure Arc-enabled SQL Managed Instance is the same technology that is in SQL Server. Because Azure Arc-enabled SQL Managed Instance runs on Kubernetes, there's no Windows failover cluster involved. For more information, see [Distributed availability groups](/sql/database-engine/availability-groups/windows/distributed-availability-groups).
21+
Azure failover groups use the same distributed availability groups technology that is in SQL Server. Because Azure Arc-enabled SQL Managed Instance runs on Kubernetes, there's no Windows failover cluster involved. For more information, see [Distributed availability groups](/sql/database-engine/availability-groups/windows/distributed-availability-groups).
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.
2525
> - Distributed availability groups can be setup for either General Purpose or Business Critical service tiers.
2626
27-
To configure disaster recovery:
27+
To configure an Azure failover group:
2828

2929
1. Create custom resource for distributed availability group at the primary site
3030
1. Create custom resource for distributed availability group at the secondary site
31-
1. Copy the mirroring certificates
31+
1. Copy the binary data from the mirroring certificates
3232
1. Set up the distributed availability group between the primary and secondary sites
3333

3434
The following image shows a properly configured distributed availability group:
3535

3636
![A properly configured distributed availability group](.\media\business-continuity\dag.png)
3737

38-
### Configure distributed availability groups
38+
### Configure Azure failover group
3939

4040
1. Provision the managed instance in the primary site.
4141

4242
```azurecli
4343
az sql mi-arc create --name <primaryinstance> --tier bc --replicas 3 --k8s-namespace <namespace> --use-k8s
4444
```
4545

46-
2. Provision the managed instance in the secondary site and configure as a disaster recovery instance. At this point, the system databases are not part of the contained availability group.
46+
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.
4747

4848
> [!NOTE]
4949
> - 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.
@@ -54,19 +54,40 @@ The following image shows a properly configured distributed availability group:
5454
az sql mi-arc create --name <secondaryinstance> --tier bc --replicas 3 --license-type DisasterRecovery --k8s-namespace <namespace> --use-k8s
5555
```
5656

57-
3. Copy the mirroring certificates from each site to a location that's accessible to both the geo-primary and geo-secondary instances.
57+
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.
5858

59-
```azurecli
60-
az sql mi-arc get-mirroring-cert --name <primaryinstance> --cert-file $HOME/sqlcerts/<name>.pem​ --k8s-namespace <namespace> --use-k8s
61-
az sql mi-arc get-mirroring-cert --name <secondaryinstance> --cert-file $HOME/sqlcerts/<name>.pem --k8s-namespace <namespace> --use-k8s
62-
```
59+
This can be achieved in a few ways:
6360

64-
Example:
61+
(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.
6562

66-
```azurecli
67-
az sql mi-arc get-mirroring-cert --name sqlprimary --cert-file $HOME/sqlcerts/sqlprimary.pem​ --k8s-namespace my-namespace --use-k8s
68-
az sql mi-arc get-mirroring-cert --name sqlsecondary --cert-file $HOME/sqlcerts/sqlsecondary.pem --k8s-namespace my-namespace --use-k8s
69-
```
63+
(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.
64+
65+
66+
Using (a) above:
67+
68+
Create the mirroring certificate file for primary instance:
69+
```azurecli
70+
az sql mi-arc get-mirroring-cert --name <primaryinstance> --cert-file </path/name>.pem​ --k8s-namespace <namespace> --use-k8s
71+
```
72+
73+
Example:
74+
```azurecli
75+
az sql mi-arc get-mirroring-cert --name sqlprimary --cert-file $HOME/sqlcerts/sqlprimary.pem​ --k8s-namespace my-namespace --use-k8s
76+
```
77+
78+
Connect to the secondary cluster and create the mirroring certificate file for secondary instance:
79+
80+
```azurecli
81+
az sql mi-arc get-mirroring-cert --name <secondaryinstance> --cert-file </path/name>.pem --k8s-namespace <namespace> --use-k8s
82+
```
83+
84+
Example:
85+
86+
```azurecli
87+
az sql mi-arc get-mirroring-cert --name sqlsecondary --cert-file $HOME/sqlcerts/sqlsecondary.pem --k8s-namespace my-namespace --use-k8s
88+
```
89+
90+
Once the mirroring certificate files are created, copy the certificate from the secondary instance to a shared/local path on the primary instance cluster and vice-versa.
7091
7192
4. Create the failover group resource on both sites.
7293
@@ -76,16 +97,21 @@ The following image shows a properly configured distributed availability group:
7697
7798
```azurecli
7899
az sql instance-failover-group-arc create --shared-name <name of failover group> --name <name for primary DAG 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
100+
```
101+
102+
Example:
103+
```azurecli
104+
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
105+
```
79106
107+
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.
80108
109+
```azurecli
81110
az sql instance-failover-group-arc create --shared-name <name of failover group> --name <name for secondary DAG 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
82111
```
83112
84113
Example:
85-
86114
```azurecli
87-
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
88-
89115
az sql instance-failover-group-arc create --shared-name myfog --name secondarycr --mi sqlinstance2 --role secondary --partner-mi sqlinstance1 --partner-mirroring-url tcp://10.10.5.20:970 --partner-mirroring-cert-file $HOME/sqlcerts/sqlinstance1.pem --k8s-namespace my-namespace --use-k8s
90116
```
91117

0 commit comments

Comments
 (0)