HiveBrain v1.2.0
Get Started
← Back to all entries
debugMinor

What is causing this error: None of the specified replicas for availability group ag1 maps to the instance of SQL Server to which you are connected

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
groupwhicherrorreplicasyouthearemapsinstancefor

Problem

I am configuring Always-on for SQL Server 2017 RC1 (14.0.80.90, dated 2017-7-18) for Linux as per https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-availability-group-configure-ha. This install is using docker images, all on the same physical host. All the steps are working until I get to the step:

CREATE AVAILABILITY GROUP [ag1]
    WITH (DB_FAILOVER = ON, CLUSTER_TYPE = EXTERNAL)
    FOR REPLICA ON
        N'always-onA' 
         WITH (
            ENDPOINT_URL = N'tcp://always-onA:5022',
            AVAILABILITY_MODE = SYNCHRONOUS_COMMIT,
            FAILOVER_MODE = EXTERNAL,
            SEEDING_MODE = AUTOMATIC
            ),
        N'always-onB' 
         WITH ( 
            ENDPOINT_URL = N'tcp://always-onB:5022', 
            AVAILABILITY_MODE = SYNCHRONOUS_COMMIT,
            FAILOVER_MODE = EXTERNAL,
            SEEDING_MODE = AUTOMATIC
            ),
        N'always-onC'
        WITH( 
           ENDPOINT_URL = N'tcp://always-onC:5022', 
           AVAILABILITY_MODE = SYNCHRONOUS_COMMIT,
           FAILOVER_MODE = EXTERNAL,
           SEEDING_MODE = AUTOMATIC
           );


And I get the error message:

Msg 35237, Level 16, State 1, Line 2
None of the specified replicas for availability group ag1 maps to the instance of SQL Server to which you are connected. Reenter the command, specifying this server instance to host one of the replicas. This replica will be the initial primary replica.


I have reviewed the release notes at https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-release-notes to insure that there are no known issues, and that this feature should be supported at this time.

Within each docker container, the names "always-onX" resolve:

```
> root@5194403487fe:/# ping always-onA
> PING always-onA (172.17.0.10): 56 data bytes
> 64 bytes from 172.17.0.10: icmp_seq=0 ttl=64 time=0.125 ms
> ^C--- always-onA ping statistics ---
> 1 packets transmitted, 1 packets received, 0% packet loss
>

Solution

Resolved: The issue is that when creating the availability group, the node specifier, i.e. N'name' needs to use the EXACT name that is returned as per the "hostname" command. Using any other identifier, even if it resolves to the correct IP, does not appear to work.

Context

StackExchange Database Administrators Q#181580, answer score: 8

Revisions (0)

No revisions yet.