Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 8faa58b

Browse files
committed
Update.
1 parent da7b8d2 commit 8faa58b

1 file changed

Lines changed: 28 additions & 9 deletions

File tree

docs/linux/sql-server-linux-availability-group-cross-platform.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ In this scenario, two servers are on different operating systems. A Windows Serv
3434

3535
The steps to create the AG are the same as the steps to create an AG for read-scale workloads. The AG cluster type is NONE, because there is no cluster manager.
3636

37+
>[!NOTE]
38+
>For the scripts in this article, angle brackets `<` and `>` identify values that you need to replace for your environment. The angle brackets themselves are not required for the scripts.
39+
3740
1. Install SQL Server 2017 on Windows Server 2016 and enable Availability Groups from SQL Server Configuration Manager.
3841

3942
![Enable Availability Groups](./media/sql-server-linux-availability-group-cross-platform/1-sqlserver-configuration-manager.png)
@@ -61,13 +64,6 @@ The steps to create the AG are the same as the steps to create an AG for read-sc
6164

6265
1. Open up firewall ports for TPC 1433 and 5022 on both Windows and Linux.
6366

64-
1. Create a database for the AG. The example steps use a database named `<TestDB>`.
65-
66-
>[!NOTE]
67-
>For the scripts in this article, angle brackets `<` and `>` identify values that you need to replace for your environment. The angle brackets themselves are not required for the scripts.
68-
69-
1. Take a full backup of the database.
70-
7167
1. On the primary replica, create a database login and password.
7268

7369
```sql
@@ -173,7 +169,6 @@ The steps to create the AG are the same as the steps to create an AG for read-sc
173169
>[!NOTE]
174170
>The preceding script uses `SEEDING_MODE = AUTOMATIC` to create the AG. SQL Server 2017 introduces support for automatic seeding in an availability group even if the disk layout is different. This capability supports cross-platform availability groups. For more information, see [Automatic Seeding - Disk Layout](../database-engine/availability-groups/windows/automatic-seeding-secondary-replicas.md#disklayout).
175171
176-
177172
1. On the secondary replica, join the AG.
178173

179174
```sql
@@ -182,7 +177,31 @@ The steps to create the AG are the same as the steps to create an AG for read-sc
182177
GO
183178
```
184179

185-
1. On the primary replica, run the SQL query to add the db to the AG.
180+
1. Create a database for the AG. The example steps use a database named `<TestDB>`.
181+
182+
>[!IMPORTANT]
183+
>If you are using Azure Virtual Machines, the Windows Server places the data files on `F:\Data\` and the log files on `F:\Log`. For automatic seeding to work, place both data an log files in the same directory.
184+
185+
The following command creates a database and places the data and log files in the `F:\Data\` directory. Before you run the command, replace the database name, and database file names. Also, verify that the file path exists on the primary replica server.
186+
187+
```sql
188+
CREATE DATABASE [<TestDB>]
189+
CONTAINMENT = NONE
190+
ON PRIMARY
191+
( NAME = N'<TestDB>', FILENAME = N'F:\Data\<TestDB>.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
192+
LOG ON
193+
( NAME = N'<TestDB>_log', FILENAME = N'F:\Data\<TestDB>_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
194+
GO
195+
196+
```
197+
198+
1. Take a full backup of the database. If you don't need to store a full backup at this time, you can back up the database to `NUL:` This does not create a backup file. The following command backs up the database to `NUL:`:
199+
200+
```sql
201+
BACKUP DATABASE <TestDB> TO DISK = N'NUL:'
202+
```
203+
204+
1. On the primary replica, run the SQL query to add the database to the AG.
186205

187206
```sql
188207
ALTER AVAILABILITY GROUP [ag1] ADD DATABASE <TestDB>

0 commit comments

Comments
 (0)