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: docs/linux/sql-server-linux-containter-ha-overview.md
+32-25Lines changed: 32 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,55 +15,62 @@ ms.technology: linux
15
15
16
16
# High availability for SQL Server containers
17
17
18
-
SQL Server workloads on containers can provide high availability with container orchestration through [Kubernetes](http://kubernetes.io/).
18
+
Create and manage your SQL Server instances natively in Kubernetes.
19
19
20
-
Two deployment patterns on Kubernetescan provide high availability for SQL Server.
20
+
You can [deploy SQL Server to docker containers](tutorial-sql-server-ag-kubernetes.md) managed by [Kubernetes](https://kubernetes.io/). In Kubernetes, a container with a SQL Server instance to automatically recover in case a cluster node fails. For faster recovery, you can configure SQL Server Always On availability group with SQL Server instances in containers on a Kubernetes cluster. This article compares the two solutions.
21
21
22
-
*[A SQL Server Always On availability group hosted on SQL Server containers in Kubernetes](tutorial-sql-server-ag-kubernetes.md).
22
+
## Container with SQL Server instance on Kubernetes
23
23
24
-
*[A SQL Server container with peristent storage](tutorial-sql-server-containers-kubernetes.md).
24
+
Kubernetes 1.6 and later has support for [*storage classes*](http://kubernetes.io/docs/concepts/storage/storage-classes/), [*persistent volume claims*](http://kubernetes.io/docs/concepts/storage/storage-classes/#persistentvolumeclaims), and the [*Azure disk volume type*](https://github.com/kubernetes/examples/tree/master/staging/volumes/azure_disk).
25
25
26
-
## A SQL Server Always On availability group hosted on SQL Server containers in Kubernetes
26
+
In this configuration, Kubernetes plays the role of the container orchestrator.
27
+
28
+

29
+
30
+
In the preceding diagram, `mssql-server` is a SQL Server instance (container) in a [*pod*](http://kubernetes.io/docs/concepts/workloads/pods/pod/). A [replica set](http://kubernetes.io/docs/concepts/workloads/controllers/replicaset/) ensures that the pod is automatically recovered after a node failure. Applications connect to the service. In this case, the service represents a load balancer that hosts an IP address that stays the same after failure of the `mssql-server`.
31
+
32
+
Kubernetes orchestrates the resources in the cluster. When a pod or node hosting a SQL Server instance in a container fails, the orchestrator bootstraps another container with a SQL Server instance and attaches it to the same persistent storage.
33
+
34
+
## A SQL Server Always On availability group on SQL Server containers in Kubernetes
27
35
28
36
SQL Server vNext supports availability groups on containers in a Kubernetes. For availability groups, deploy the SQL Server [Kubernetes operator](http://coreos.com/blog/introducing-operators.html) to your Kubernetes cluster. The operator helps package, deploy, and manage the availability group in a cluster.
29
37
30
38

31
39
32
-
In the image above, a four-node kubernetes clusters host an availability group with three replicas. The solution includes the following components:
40
+
In the image above, a four-node kubernetes cluster hosts an availability group with three replicas. The solution includes the following components:
33
41
34
42
* A Kubernetes [*deployment*](http://kubernetes.io/docs/concepts/workloads/controllers/deployment/). The deployment includes the operator and a configuration map. These provide the container image, software, and instructions required to deploy SQL Server instances for the availability group.
35
43
36
-
* Three nodes, each hosting a [*StatefulSet*](http://kubernetes.io/docs/concepts/workloads/controllers/statefulset/). The StatefulSet contains a [*pod*](http://kubernetes.io/docs/concepts/workloads/pods/pod-overview/). Each pod contains:
44
+
* Three nodes, each hosting a [*StatefulSet*](http://kubernetes.io/docs/concepts/workloads/controllers/statefulset/). The StatefulSet contains a pod. Each pod contains:
37
45
* A SQL Server container running one instance of SQL Server.
38
-
* An availability group agent.
46
+
* An availability group agent.
39
47
40
48
* Two [*ConfigMaps*](http://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/) related to the availability group. The ConfigMaps provide information about:
41
49
* The deployment for the operator.
42
50
* The availability group.
43
51
44
-
*[*Persistent volumes*](http://kubernetes.io/docs/concepts/storage/persistent-volumes/) are pieces of storage. A *persistent volume claim* (PVC) is a request for storage by a user. Each container is affiliated with a PVC for the data and log storage. In Azure Kubernetes Service (AKS), you [create a persistent volume claim](http://docs.microsoft.com/azure/aks/azure-disks-dynamic-pv) to automatically provision storage based on a storage class.
45
-
52
+
* Persistent volumes for each instance of SQL Server provide the storage for the data and log files.
46
53
47
54
In addition, the cluster stores [*secrets*](http://kubernetes.io/docs/concepts/configuration/secret/) for the passwords, certificates, keys, and other sensitive information.
48
55
49
-
## SQL Server container with persistent storage
56
+
## Compare SQL Server high availabiltiy on containers with and without the availability group
50
57
51
-
Kubernetes 1.6 and later has support for [storage classes](http://kubernetes.io/docs/concepts/storage/storage-classes/), [persistent volume claims](http://kubernetes.io/docs/concepts/storage/storage-classes/#persistentvolumeclaims), and the [Azure disk volume type](https://github.com/kubernetes/examples/tree/master/staging/volumes/azure_disk). You can create and manage your SQL Server instances natively in Kubernetes. The example in this article shows how to create a [deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) to achieve a high availability configuration similar to a shared disk failover cluster instance. In this configuration, Kubernetes plays the role of the cluster orchestrator. When a SQL Server instance in a container fails, the orchestrator bootstraps another instance of the container that attaches to the same persistent storage.
58
+
The following table compairs the high SQL Server availability capability containers on Kubernetes with, and without an availabilty group:
52
59
53
-

54
-
55
-
In the preceding diagram, `mssql-server` is a container in a [pod](http://kubernetes.io/docs/concepts/workloads/pods/pod/). Kubernetes orchestrates the resources in the cluster. A [replica set](http://kubernetes.io/docs/concepts/workloads/controllers/replicaset/) ensures that the pod is automatically recovered after a node failure. Applications connect to the service. In this case, the service represents a load balancer that hosts an IP address that stays the same after failure of the `mssql-server`.
56
-
57
-
In the following diagram, the `mssql-server` container has failed. As the orchestrator, Kubernetes guarantees the correct count of healthy instances in the replica set, and starts a new container according to the configuration. The orchestrator starts a new pod on the same node, and `mssql-server` reconnects to the same persistent storage. The service connects to the re-created `mssql-server`.
58
-
59
-

60
-
61
-
In the following diagram, the node hosting the `mssql-server` container has failed. The orchestrator starts the new pod on a different node, and `mssql-server` reconnects to the same persistent storage. The service connects to the re-created `mssql-server`.
62
-
63
-

60
+
| |With an availability group | Standalone container instance
61
+
|:------|:------|:------
62
+
|Automatically recover from node failure | Yes | Yes
63
+
|Automatically recover from pod failure | Yes | Yes
64
+
|Faster failover |Yes |
65
+
|Automatically recover from SQL Server instance failure | Yes |
66
+
|Automatically recover from database health check failure | Yes |
67
+
|Provide read-only replicas | Yes |
68
+
|Secondary replica backup | Yes |
64
69
65
70
## Next steps
66
71
67
-
[Configure a SQL Server container in Kubernetes for high availability](tutorial-sql-server-containers-kubernetes.md)
72
+
To deploy SQL Server containers in Azure Kubernetes Service (AKS), follow one of these tutorials:
73
+
74
+
*[Deploy a SQL Server container in Kubernetes](tutorial-sql-server-containers-kubernetes.md).
75
+
*[Deploy a SQL Server Always On availability group Kubernetes](tutorial-sql-server-ag-kubernetes.md).
68
76
69
-
[Configure a SQL Server Always On availability group on Docker containers in Kubernetes with Azure Kubernetes Service (AKS)](tutorial-sql-server-ag-kubernetes.md)
0 commit comments