Endpoints for availability groups

David C 191 Reputation points
2023-04-24T06:20:16.0166667+00:00

Hi. In the past I created AlwaysOn availability groups using the wizard. I specified the endpoint_URL as a FQDN like this example: TCP://hostname.xxx.yyy.zzz:50xx I didn't have to create any TCP endpoints. If I install using T-SQL, I will use the following including the endpoint URL:

CREATE AVAILABILITY GROUP AG1
   WITH (
	AUTOMATED_BACKUP_PREFERENCE = SECONDARY,
	DB_FAILOVER = ON,
	DTC_SUPPORT = NONE,
	REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT = 0
	)
   FOR   
      DATABASE Test1
   REPLICA ON   
      N'<server_name>' WITH
        (
       	ENDPOINT_URL = 'hostname.xxx.yyy.zzz:50xx'
etc.
etc.

I read a post that says I first separately need to create the TCP endpoint and assign connect permission to the SQL service account like the following:

CREATE ENDPOINT Hadr_endpoint  
    STATE=STARTED   
    AS TCP (LISTENER_PORT=50xx)   
    FOR DATABASE_MIRRORING (ROLE=ALL);  
GO

GRANT CONNECT ON ENDPOINT::[Hadr_endpoint] TO [NT Service\MSSQLSERVER]
GO

I just want to validate if the CREATE ENDPOINT and GRANT CONNECT is actually necessary. Also, what can I specify as the endpoint name to substitute in place of "Hadr_endpoint"? Thanks.

SQL Server | Other
{count} votes

Accepted answer
  1. Erland Sommarskog 121.8K Reputation points MVP Volunteer Moderator
    2023-04-24T21:00:40.39+00:00

    Yes, that seems familiar. You need to create an endpoint and grant permission on it.

    As for the name, you can call i Gretchen, hadr_endpoint, or whatever you prefer.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.