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
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,910 questions
{count} votes

0 additional answers

Sort by: Most helpful