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: articles/virtual-machines/windows/sql/virtual-machines-windows-portal-sql-availability-group-tutorial.md
+25-21Lines changed: 25 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ The following table lists the prerequisites that you need to complete before sta
42
42
|| Windows Server | File share for cluster witness |
43
43
||SQL Server service account | Domain account |
44
44
||SQL Server Agent service account | Domain account |
45
-
||Firewall ports open | - SQL Server: **1433** for default instance <br/> - Database mirroring endpoint: **5022** or any available port <br/> - Azure load balancer probe: **59999** or any available port |
45
+
||Firewall ports open | - SQL Server: **1433** for default instance <br/> - Database mirroring endpoint: **5022** or any available port <br/> - Availability group load balancer IP address health probe: **59999** or any available port <br/> - Cluster core load balancer IP address health probe: **58888** or any available port |
46
46
||Add Failover Clustering Feature | Both SQL Servers require this feature |
47
47
||Installation domain account | - Local administrator on each SQL Server <br/> - Member of SQL Server sysadmin fixed server role for each instance of SQL Server |
48
48
@@ -75,7 +75,7 @@ After the prerequisites are completed, the first step is to create a Windows Ser
75
75
| Access Point for Administering the Cluster |Type a cluster name, for example **SQLAGCluster1** in **Cluster Name**.|
76
76
| Confirmation |Use defaults unless you are using Storage Spaces. See the note following this table. |
77
77
78
-
### Set the cluster IP address
78
+
### Set the Windows server failover cluster IP address
79
79
80
80
1. In **Failover Cluster Manager**, scroll down to **Cluster Core Resources** and expand the cluster details. You should see both the **Name** and the **IP Address** resources in the **Failed** state. The IP address resource cannot be brought online because the cluster is assigned the same IP address as the machine itself, therefore it is a duplicate address.
81
81
@@ -340,13 +340,15 @@ At this point, you have an Availability Group with replicas on two instances of
340
340
341
341
On Azure virtual machines, a SQL Server Availability Group requires a load balancer. The load balancer holds the IP addresses for the Availability Group listeners and the Windows Server Failover Cluster. This section summarizes how to create the load balancer in the Azure portal.
342
342
343
+
An Azure Load Balancer can be either a Standard Load Balancer or a Basic Load Balancer. Standard Load Balancer has more features than the Basic Load Balancer. For an availability group, the Standard Load Balancer is required if you use an Availability Zone (instead of an Availability Set). For details on the difference between the load balancer types, see [Load Balancer SKU comparison](../../../load-balancer/load-balancer-overview.md#skus).
344
+
343
345
1. In the Azure portal, go to the resource group where your SQL Servers are and click **+ Add**.
344
-
2. Search for **Load Balancer**. Choose the load balancer published by Microsoft.
346
+
1. Search for **Load Balancer**. Choose the load balancer published by Microsoft.
345
347
346
348

347
349
348
-
1.Click **Create**.
349
-
3. Configure the following parameters for the load balancer.
350
+
1. Click **Create**.
351
+
1. Configure the following parameters for the load balancer.
350
352
351
353
| Setting | Field |
352
354
| --- | --- |
@@ -355,7 +357,7 @@ On Azure virtual machines, a SQL Server Availability Group requires a load balan
355
357
|**Virtual network**|Use the name of the Azure virtual network. |
356
358
|**Subnet**|Use the name of the subnet that the virtual machine is in. |
357
359
|**IP address assignment**|Static |
358
-
|**IP address**|Use an available address from subnet. Note that this is different from your cluster IP address |
360
+
|**IP address**|Use an available address from subnet. Use this address for your availability group listener. Note that this is different from your cluster IP address. |
359
361
|**Subscription**|Use the same subscription as the virtual machine. |
360
362
|**Location**|Use the same location as the virtual machine. |
361
363
@@ -373,7 +375,9 @@ To configure the load balancer, you need to create a backend pool, a probe, and
373
375
374
376

375
377
376
-
1. Click the load balancer, click **Backend pools**, and click **+Add**.
378
+
1. Click the load balancer, click **Backend pools**, and click **+Add**.
379
+
380
+
1. Type a name for the backend pool.
377
381
378
382
1. Associate the backend pool with the availability set that contains the VMs.
379
383
@@ -388,7 +392,7 @@ To configure the load balancer, you need to create a backend pool, a probe, and
388
392
389
393
1. Click the load balancer, click **Health probes**, and click **+Add**.
390
394
391
-
1. Set the health probe as follows:
395
+
1. Set the listener health probe as follows:
392
396
393
397
| Setting | Description | Example
394
398
| --- | --- |---
@@ -404,14 +408,14 @@ To configure the load balancer, you need to create a backend pool, a probe, and
404
408
405
409
1. Click the load balancer, click **Load balancing rules**, and click **+Add**.
406
410
407
-
1. Set the load balancing rules as follows.
411
+
1. Set the listener load balancing rules as follows.
408
412
| Setting | Description | Example
409
413
| --- | --- |---
410
414
|**Name**| Text | SQLAlwaysOnEndPointListener |
411
415
|**Frontend IP address**| Choose an address |Use the address that you created when you created the load balancer. |
412
416
|**Protocol**| Choose TCP |TCP |
413
-
|**Port**| Use the port for the availability group listener |1435|
414
-
|**Backend Port**| This field is not used when Floating IP is set for direct server return |1435|
417
+
|**Port**| Use the port for the availability group listener |1433|
418
+
|**Backend Port**| This field is not used when Floating IP is set for direct server return |1433|
415
419
|**Probe**|The name you specified for the probe | SQLAlwaysOnEndPointProbe |
416
420
|**Session Persistence**| Drop down list |**None**|
417
421
|**Idle Timeout**| Minutes to keep a TCP connection open | 4 |
@@ -420,17 +424,17 @@ To configure the load balancer, you need to create a backend pool, a probe, and
420
424
> [!WARNING]
421
425
> Direct server return is set during creation. It cannot be changed.
422
426
423
-
1. Click **OK** to set the load balancing rules.
427
+
1. Click **OK** to set the listener load balancing rules.
424
428
425
-
### Add the front end IP address for the WSFC
429
+
### Add the cluster core IP address for the Windows Server Failover Cluster (WSFC)
426
430
427
431
The WSFC IP address also needs to be on the load balancer.
428
432
429
-
1. In the portal, add a new Frontend IP configuration for the WSFC. Use the IP Address you configured for the WSFC in the cluster core resources. Set the IP address as static.
433
+
1. In the portal, on the same Azure load balancer, click **Frontend IP configuration** and click **+Add**. Use the IP Address you configured for the WSFC in the cluster core resources. Set the IP address as static.
430
434
431
-
1.Click the load balancer, click **Health probes**, and click **+Add**.
435
+
1.On the load balancer, click **Health probes**, and click **+Add**.
432
436
433
-
1. Set the health probe as follows:
437
+
1. Set the WSFC cluster core IP address health probe as follows:
434
438
435
439
| Setting | Description | Example
436
440
| --- | --- |---
@@ -444,13 +448,13 @@ The WSFC IP address also needs to be on the load balancer.
444
448
445
449
1. Set the load balancing rules. Click **Load balancing rules**, and click **+Add**.
446
450
447
-
1. Set the load balancing rules as follows.
451
+
1. Set the cluster core IP address load balancing rules as follows.
448
452
| Setting | Description | Example
449
453
| --- | --- |---
450
-
|**Name**| Text |WSFCEndPointListener|
451
-
|**Frontend IP address**| Choose an address |Use the address that you created when you configured the WSFC IP address. |
454
+
|**Name**| Text |WSFCEndPoint|
455
+
|**Frontend IP address**| Choose an address |Use the address that you created when you configured the WSFC IP address. This is different from the listener IP address |
452
456
|**Protocol**| Choose TCP |TCP |
453
-
|**Port**| Use the port for the availability group listener | 58888 |
457
+
|**Port**| Use the port for the cluster IP address. This is an available port that is not used for the listener probe port.| 58888 |
454
458
|**Backend Port**| This field is not used when Floating IP is set for direct server return | 58888 |
455
459
|**Probe**|The name you specified for the probe | WSFCEndPointProbe |
456
460
|**Session Persistence**| Drop down list |**None**|
@@ -483,7 +487,7 @@ In SQL Server Management Studio, set the listener port.
483
487
484
488
1. You should now see the listener name that you created in Failover Cluster Manager. Right-click the listener name and click **Properties**.
485
489
486
-
1. In the **Port** box, specify the port number for the Availability Group listener by using the $EndpointPort you used earlier (1433 was the default), then click **OK**.
490
+
1. In the **Port** box, specify the port number for the Availability Group listener. 1433 is the default, then click **OK**.
487
491
488
492
You now have a SQL Server Availability Group in Azure virtual machines running in Resource Manager mode.
2. <aname="addcap"></a>Add the client access point.
13
+
1. <aname="addcap"></a>Add the client access point.
14
14
The client access point is the network name that applications use to connect to the databases in an availability group. Create the client access point in Failover Cluster Manager.
15
15
16
16
a. Expand the cluster name, and then click **Roles**.
@@ -24,7 +24,9 @@ The availability group listener is an IP address and network name that the SQL S
24
24
25
25
d. To finish creating the listener, click **Next** twice, and then click **Finish**. Do not bring the listener or resource online at this point.
26
26
27
-
3. <aname="congroup"></a>Configure the IP resource for the availability group.
27
+
1. Take the availability group cluster role offline. In **Failover Cluster Manager** under **Roles**, right-click the role, and select **Stop Role**.
28
+
29
+
1. <aname="congroup"></a>Configure the IP resource for the availability group.
28
30
29
31
a. Click the **Resources** tab, and then expand the client access point you created.
30
32
The client access point is offline.
@@ -41,7 +43,7 @@ The availability group listener is an IP address and network name that the SQL S
41
43
1. Disable NetBIOS for this address and click **OK**. Repeat this step for each IP resource if your solution spans multiple Azure VNets.
42
44
------------------------->
43
45
44
-
4. <aname = "dependencyGroup"></a>Make the SQL Server availability group resource dependent on the client access point.
46
+
1. <aname = "dependencyGroup"></a>Make the SQL Server availability group resource dependent on the client access point.
45
47
46
48
a. In Failover Cluster Manager, click **Roles**, and then click your availability group.
47
49
@@ -53,7 +55,7 @@ The availability group listener is an IP address and network name that the SQL S
53
55
54
56
d. Click **OK**.
55
57
56
-
5. <aname="listname"></a>Make the client access point resource dependent on the IP address.
58
+
1. <aname="listname"></a>Make the client access point resource dependent on the IP address.
57
59
58
60
a. In Failover Cluster Manager, click **Roles**, and then click your availability group.
59
61
@@ -65,34 +67,37 @@ The availability group listener is an IP address and network name that the SQL S
d. Right-click the listener name, and then click **Bring Online**.
69
-
70
70
>[!TIP]
71
71
>You can validate that the dependencies are correctly configured. In Failover Cluster Manager, go to Roles, right-click the availability group, click **More Actions**, and then click **Show Dependency Report**. When the dependencies are correctly configured, the availability group is dependent on the network name, and the network name is dependent on the IP address.
72
72
73
73
74
-
6. <aname="setparam"></a>Set the cluster parameters in PowerShell.
74
+
1. <aname="setparam"></a>Set the cluster parameters in PowerShell.
75
75
76
76
a. Copy the following PowerShell script to one of your SQL Server instances. Update the variables for your environment.
77
77
78
-
-`$ILBIP` is the IP address that you created on the Azure load balancer for the availability group listener.
78
+
-`$ListenerILBIP` is the IP address that you created on the Azure load balancer for the availability group listener.
79
79
80
-
-`$ProbePort` is the port you configured on the Azure load balancer for the availability group listener.
80
+
-`$ListenerProbePort` is the port you configured on the Azure load balancer for the availability group listener.
81
81
82
82
```PowerShell
83
83
$ClusterNetworkName = "<MyClusterNetworkName>" # the cluster network name (Use Get-ClusterNetwork on Windows Server 2012 of higher to find the name)
84
84
$IPResourceName = "<IPResourceName>" # the IP Address resource name
85
-
$ILBIP = "<n.n.n.n>" # the IP Address of the Internal Load Balancer (ILB). This is the static IP address for the load balancer you configured in the Azure portal.
86
-
[int]$ProbePort = <nnnnn>
85
+
$ListenerILBIP = "<n.n.n.n>" # the IP Address of the Internal Load Balancer (ILB). This is the static IP address for the load balancer you configured in the Azure portal.
b. Set the cluster parameters by running the PowerShell script on one of the cluster nodes.
94
94
95
-
Repeat the steps above to set the cluster parameters for the WSFC cluster IP address.
95
+
> [!NOTE]
96
+
> If your SQL Server instances are in separate regions, you need to run the PowerShell script twice. The first time, use the `$ListenerILBIP` and `$ListenerProbePort` from the first region. The second time, use the `$ListenerILBIP` and `$ListenerProbePort` from the second region. The cluster network name and the cluster IP resource name are also different for each region.
97
+
98
+
1. Bring the availability group cluster role online. In **Failover Cluster Manager** under **Roles**, right click the role, and select **Start Role**.
99
+
100
+
If necessary, repeat the steps above to set the cluster parameters for the WSFC cluster IP address.
96
101
97
102
1. Get the IP address name of the WSFC Cluster IP address. In **Failover Cluster Manager** under **Cluster Core Resources**, locate **Server Name**.
98
103
@@ -104,22 +109,22 @@ Repeat the steps above to set the cluster parameters for the WSFC cluster IP add
104
109
105
110
a. Copy the following PowerShell script to one of your SQL Server instances. Update the variables for your environment.
106
111
107
-
-`$ILBIP` is the IP address that you created on the Azure load balancer for the WSFC core cluster resource. It is different from the IP address for the availability group listener.
112
+
-`$ClusterCoreIP` is the IP address that you created on the Azure load balancer for the WSFC core cluster resource. It is different from the IP address for the availability group listener.
108
113
109
-
-`$ProbePort` is the port you configured on the Azure load balancer for the WSFC health probe. It is different from the probe for the availability group listener.
114
+
-`$ClusterProbePort` is the port you configured on the Azure load balancer for the WSFC health probe. It is different from the probe for the availability group listener.
110
115
111
116
```PowerShell
112
117
$ClusterNetworkName = "<MyClusterNetworkName>" # the cluster network name (Use Get-ClusterNetwork on Windows Server 2012 of higher to find the name)
113
118
$IPResourceName = "<ClusterIPResourceName>" # the IP Address resource name
114
-
$ILBIP = "<n.n.n.n>" # the IP Address of the Cluster IP resource. This is the static IP address for the load balancer you configured in the Azure portal.
115
-
[int]$ProbePort = <nnnnn> # The probe port from the WSFCEndPointprobe in the Azure portal. This port must be different from the probe port for the availability grouop listener probe port.
119
+
$ClusterCoreIP = "<n.n.n.n>" # the IP Address of the Cluster IP resource. This is the static IP address for the load balancer you configured in the Azure portal.
120
+
[int]$ClusterProbePort = <nnnnn> # The probe port from the WSFCEndPointprobe in the Azure portal. This port must be different from the probe port for the availability grouop listener probe port.
b. Set the cluster parameters by running the PowerShell script on one of the cluster nodes.
123
128
124
-
> [!NOTE]
125
-
> If your SQL Server instances are in separate regions, you need to run the PowerShell script twice. The first time, use the `$ILBIP` and `$ProbePort` from the first region. The second time, use the `$ILBIP` and `$ProbePort` from the second region. The cluster network name and the cluster IP resource name are the same.
129
+
>[!WARNING]
130
+
>The availability group listener health probe port has to be different from the cluster core IP address health probe port. In these examples, the listener port is 59999 and the cluster core IP address is 58888. Both ports require an allow inbound firewall rule.
0 commit comments