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/database-engine/availability-groups/windows/configure-distributed-availability-groups.md
+17-12Lines changed: 17 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,13 @@ To create a distributed availability group, you must create an availability grou
22
22
23
23
For a technical overview of distributed availability groups, see [Distributed availability groups](distributed-availability-groups.md).
24
24
25
-
## Set the endpoint listeners to listen to all IP addresses
25
+
## Prerequisites
26
+
27
+
### Set the endpoint listeners to listen to all IP addresses
26
28
27
29
Make sure the endpoints can communicate between the different availability groups in the distributed availability group. If one availability group is set to a specific network on the endpoint, the distributed AG will not work properly. On each server that will host a replica in the distributed availability group, configure the listener to `LISTENER_IP = ALL`.
28
30
29
-
### Create a listener to listen to all IP addresses
31
+
####Create a listener to listen to all IP addresses
30
32
31
33
For example, the following script creates a listener endpoint on TCP port 5022 that listens on all IP addresses.
32
34
@@ -42,7 +44,7 @@ FOR DATA_MIRRORING (
42
44
GO
43
45
```
44
46
45
-
### Alter a listener to listen to all IP addresses
47
+
####Alter a listener to listen to all IP addresses
46
48
47
49
For example, the following script changes a listener endpoint to listen on all IP addresses.
48
50
@@ -52,7 +54,9 @@ ALTER ENDPOINT [aodns-hadr]
52
54
GO
53
55
```
54
56
55
-
## Create the primary availability group on the first cluster
57
+
## Create first availability group
58
+
59
+
### Create the primary availability group on the first cluster
56
60
Create an availability group on the first WSFC. In this example, the availability group is named `ag1` for the database `db1`.
57
61
58
62
```tsql
@@ -76,7 +80,7 @@ GO
76
80
77
81
Note that this example uses direct seeding, where **SEEDING_MODE** is set to **AUTOMATIC** for both the replicas and the distributed availability group. This means that once established, the secondary replicas and secondary availability group will be automatically populated without requiring a manual backup and restore of primary database.
78
82
79
-
## Join the secondary replicas to the primary availability group
83
+
###Join the secondary replicas to the primary availability group
80
84
Any secondary replicas must be joined to the availability group with **ALTER AVAILABILITY GROUP** with the **JOIN** option. Because direct seeding is used in this example, you must also call **ALTER AVAILABILITY GROUP** with the **GRANT CREATE ANY DATABASE** option. This allows the availability group to create the database and begin seeding it automatically from the primary replica.
81
85
82
86
In this example, the following commands are run on the secondary replica, `server2`, to join the `ag1` availability group. The availability group is then permitted to create databases on the secondary.
@@ -87,7 +91,7 @@ ALTER AVAILABILITY GROUP [ag1] GRANT CREATE ANY DATABASE
87
91
GO
88
92
```
89
93
90
-
## Create a listener for the primary availability group
94
+
###Create a listener for the primary availability group
91
95
92
96
Next add a listener for the primary availability group on the first WSFC. In this example, the listener is named `ag1-listener`. For detailed instructions on creating a listener, see [Create or Configure an Availability Group Listener (SQL Server)](../../../database-engine/availability-groups/windows/create-or-configure-an-availability-group-listener-sql-server.md).
93
97
@@ -97,7 +101,8 @@ ALTER AVAILABILITY GROUP [ag1]
97
101
GO
98
102
```
99
103
100
-
## Create the secondary availability group on the second cluster
104
+
105
+
## Create second availability group
101
106
Then on the second WSFC, create a second availability group, `ag2`. In this case, the database is not specified, because it will be automatically seeded from the primary availability group.
102
107
103
108
```tsql
@@ -121,7 +126,7 @@ GO
121
126
> [!NOTE]
122
127
> Note that the secondary availability group must use the same database mirroring endpoint (in this example port 5022). Otherwise, replication will stop after a local failover.
123
128
124
-
## Join the secondary replicas to the secondary availability group
129
+
###Join the secondary replicas to the secondary availability group
125
130
In this example, the following commands are run on the secondary replica, `server4`, to join the `ag2` availability group. The availability group is then permitted to create databases on the secondary to support direct seeding.
126
131
127
132
```tsql
@@ -130,7 +135,7 @@ ALTER AVAILABILITY GROUP [ag2] GRANT CREATE ANY DATABASE
130
135
GO
131
136
```
132
137
133
-
## Create a listener for the secondary availability group
138
+
###Create a listener for the secondary availability group
134
139
Next add a listener for the secondary availability group on the second WSFC. In this example, the listener is named `ag2-listener`. For detailed instructions on creating a listener, see [Create or Configure an Availability Group Listener (SQL Server)](../../../database-engine/availability-groups/windows/create-or-configure-an-availability-group-listener-sql-server.md).
135
140
136
141
```
@@ -139,7 +144,7 @@ ALTER AVAILABILITY GROUP [ag2]
139
144
GO
140
145
```
141
146
142
-
## Create the distributed availability group on the first cluster
147
+
## Create distributed availability group on first cluster
143
148
On the first WSFC, create a distributed availability group (named `distributedag` in this example). Use the **CREATE AVAILABILITY GROUP** command with the **DISTRIBUTED** option. The **AVAILABILITY GROUP ON** parameter specifies the member availability groups, `ag1` and `ag2`.
144
149
145
150
```tsql
@@ -166,7 +171,7 @@ GO
166
171
> [!NOTE]
167
172
> The **LISTENER_URL** specifies the listener for each availability group along with the database mirroring endpoint of the availability group. In this example, that is port `5022` (not port `60173` used to create the listener).
168
173
169
-
## Join the distributed availability group on the second cluster
174
+
## Join distributed availability group on second cluster
170
175
Then join the distributed availability group on the second WSFC.
171
176
172
177
```tsql
@@ -275,7 +280,7 @@ After completing the steps above, the distributed availability group fails over
275
280
DROP AVAILABILITY GROUP [distributedag]
276
281
```
277
282
278
-
## Create a distributed availability group with failover cluster instances
283
+
## Create distributed availability group on failover cluster instances
279
284
280
285
You can create a distributed availability group using an availability group on a failover cluster instance (FCI). In this case, you don't need an availability group listener. Use the virtual network name (VNN) for the primary replica of the FCI instance. The following example shows a distributed availability group called SQLFCIDAG. One availability group is SQLFCIAG. SQLFCIAG has 2 FCI replicas. The VNN for the primary FCI replica is SQLFCIAG-1, and the VNN for the secondary FCI replica is SQLFCIAG-2. The distributed availability group also includes SQLAG-DR, for disaster recovery.
0 commit comments