Skip to content

Commit 080d23b

Browse files
committed
Merge branch 'patch-30' of https://github.com/dnethi/azure-docs-pr into 20220914-some-fog
2 parents 18d1a26 + fad2de3 commit 080d23b

File tree

1 file changed

+41
-15
lines changed

1 file changed

+41
-15
lines changed

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

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ 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

@@ -43,7 +43,7 @@ The following image shows a properly configured distributed availability group:
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)