|
1 | 1 | --- |
2 | | -title: Configuring Transactional Replication on Multiple SQL Server Linux Containers Might Fail |
| 2 | +title: Troubleshoot Issues Configuring Transactional Replication on Multiple SQL Server Linux Containers |
3 | 3 | description: Learn about a known issue when configuring transactional replication in SQL Server on Linux containers, including symptoms, cause, workaround, and resolution. |
4 | | -author: pijocoder |
5 | | -ms.author: mlandzic |
6 | | -ms.reviewer: randolphwest |
| 4 | +ms.reviewer: pijocoder, mlandzic, randolphwest, v-shaywood |
| 5 | +ms.custom: sap:Replication, Change Tracking, Change Data Capture\Errors or unexpected results during operation |
7 | 6 | ms.date: 11/03/2025 |
8 | | -ms.topic: troubleshooting |
9 | 7 | --- |
10 | 8 |
|
11 | | -# Configuring transactional replication on multiple SQL Server Linux containers might fail |
| 9 | +# Configuring transactional replication on multiple SQL Server Linux containers fails |
12 | 10 |
|
13 | | -This article guides you how to resolve an issue with two SQL Server running on Linux container on the same machine to be configured as replication subscribers. |
| 11 | +This article provides troubleshooting guidance for an issue that might occur when configuring two SQL Servers running in Linux containers on the same machine as replication subscribers. |
14 | 12 |
|
15 | 13 | ## Symptoms |
16 | 14 |
|
17 | | -When configuring **Transactional Replication** on SQL Server 2022 running in Linux containers, you might encounter the following error: |
| 15 | +When configuring **Transactional Replication** on SQL Server 2022 running in Linux containers, you might encounter the following error message: |
18 | 16 |
|
19 | | -```output |
20 | | -The subscription already exists. |
21 | | -``` |
| 17 | +> The subscription already exists. |
22 | 18 |
|
23 | | -This issue typically occurs when: |
| 19 | +This issue usually occurs when: |
24 | 20 |
|
25 | 21 | - Two SQL Server instances are hosted in separate containers on the same Linux machine. |
26 | 22 | - Both instances are added as subscribers to the same publisher. |
27 | 23 | - The connection strings use the same hostname but different port numbers (for example, `LINUXHOST,5455` and `LINUXHOST,5465`). |
28 | 24 |
|
29 | 25 | ## Cause |
30 | 26 |
|
31 | | -The issue occurs because subscriber metadata doesn't honor port numbers during persistence. Only the hostname is stored, causing the second subscriber to be perceived as a duplicate of the first. |
32 | | -This behavior is specific to Linux container environments where named instances don't exist, and connections rely on hostname and port mapping. |
| 27 | +The issue occurs because subscriber metadata doesn't honor port numbers during persistence. Only the hostname is stored, causing the second subscriber to be seen as a duplicate of the first. |
| 28 | +This behavior is specific to Linux container environments where named instances don't exist and connections rely on hostname and port mapping. |
33 | 29 |
|
34 | 30 | ## Workaround |
35 | 31 |
|
36 | | -To successfully add multiple subscribers on the same host but different containers: |
| 32 | +To successfully add multiple subscribers on the same machine but in different containers: |
37 | 33 |
|
38 | | -1. Install **Cumulative Update 20 (CU20)** for SQL Server 2022. |
| 34 | +1. Install [Cumulative Update 20 (CU20) for SQL Server 2022](https://www.catalog.update.microsoft.com/Search.aspx?q=KB5059390). |
39 | 35 |
|
40 | | -1. Enable trace flag **[15005](/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql#tf15005)**. This trace flag enables using a Subscriber with a nondefault port for transactional replication. |
| 36 | +1. Enable trace flag [15005](/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql#tf15005). This trace flag enables using a Subscriber with a nondefault port for transactional replication. |
41 | 37 |
|
42 | | -1. Perform the following manual cleanup and configuration steps in Transact-SQL. Make sure to replace `@hostname`, `@port_sub1`, `@port_sub2`, publication, publisher, and subscriber database variables with values specific to your environment: |
| 38 | +1. Perform the following manual cleanup and configuration steps in Transact-SQL. Make sure to replace the `@hostname`, `@port_sub1`, `@port_sub2`, `@PublicationName`, `@SubscriberDb_Sub1`, and `@SubscriberDb_Sub2` variables with values specific to your environment: |
43 | 39 |
|
44 | 40 | ```sql |
45 | 41 | DECLARE @hostname AS SYSNAME = 'LinuxSubscriberHostName', |
@@ -170,9 +166,9 @@ To successfully add multiple subscribers on the same host but different containe |
170 | 166 |
|
171 | 167 | ## Resolution |
172 | 168 |
|
173 | | -As of now, no permanent fix is available. The workaround is the recommended approach. |
| 169 | +Currently, no permanent fix is available. The previous [workaround](#workaround) is the recommended approach. |
174 | 170 |
|
175 | | -The product team is evaluating a fix for a future release. When resolved, this article is to be updated or retired accordingly. |
| 171 | +The product team is evaluating potential fixes for future releases. Once a permanent fix is available, this article will be updated. |
176 | 172 |
|
177 | 173 | ## Related content |
178 | 174 |
|
|
0 commit comments