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
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.
18
18
19
19
## Background
20
20
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).
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
25
> - Distributed availability groups can be setup for either General Purpose or Business Critical service tiers.
26
26
27
-
To configure disaster recovery:
27
+
To configure an Azure failover group:
28
28
29
29
1. Create custom resource for distributed availability group at the primary site
30
30
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
32
32
1. Set up the distributed availability group between the primary and secondary sites
33
33
34
34
The following image shows a properly configured distributed availability group:
1. Provision the managed instance in the primary site.
41
41
42
42
```azurecli
43
43
az sql mi-arc create --name <primaryinstance> --tier bc --replicas 3 --k8s-namespace <namespace> --use-k8s
44
44
```
45
45
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.
47
47
48
48
> [!NOTE]
49
49
> - 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:
54
54
az sql mi-arc create --name <secondaryinstance> --tier bc --replicas 3 --license-type DisasterRecovery --k8s-namespace <namespace> --use-k8s
55
55
```
56
56
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.
(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.
(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:
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.
70
91
71
92
4. Create the failover group resource on both sites.
72
93
@@ -76,16 +97,21 @@ The following image shows a properly configured distributed availability group:
76
97
77
98
```azurecli
78
99
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
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.
80
108
109
+
```azurecli
81
110
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
0 commit comments