Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
To host an availability replica for an availability group, a server instance must possess a database mirroring endpoint. The server instance uses this endpoint to listen for Always On availability groups messages from availability replicas hosted by other server instances. To define an availability replica for an availability group, you must specify the endpoint URL of the server instance that will host the replica. The endpoint URL identifies the transport protocol of the database mirroring endpoint-TCP, the system address of the server instance, and the port number associated with the endpoint.
Note
The term "endpoint URL" is synonymous with the term "server network address" used by the database mirroring user interface and documentation.
The syntax for an endpoint URL is of the form:
TCP://<system-address>:<port>
where
<system-address> is a string that unambiguously identifies the target computer system. Typically, the server address is a system name (if the systems are in the same domain), a fully qualified domain name, or an IP address:
Because the nodes of Windows Server Failover Clustering (WSFC) cluster are the same domain, you can use the name of the computer system; for example, SYSTEM46
.
To use an IP address, it must be unique in your environment. We recommend that you use an IP address only if it is static. The IP address can be IP Version 4 (IPv4) or IP Version 6 (IPv6). An IPv6 address must be enclosed within square brackets, for example: [<IPv6_address>].
To learn the IP address of a system, at the Windows command prompt, enter the ipconfig command.
The fully qualified domain name is guaranteed to work. This is a locally defined address string that takes different forms in different places. Often, but not always, a fully qualified domain name is a compound name that includes the computer name and a series of period-separated domain segments of the form:
computer_name . domain_segment[....domain_segment]
where computer_name is the network name of the computer running the server instance, and domain_segment[....domain_segment] is the remaining domain information of the server; for example: localinfo.corp.Adventure-Works.com
.
The content and number of domain segments are determined within the company or organization. For more information, see Finding the Fully Qualified Domain Name, later in this topic.
<port> is the port number used by the mirroring endpoint of the partner server instance.
A database mirroring endpoint can use any available port on the computer system. Each port number must be associated with only one endpoint, and each endpoint is associated with a single server instance; thus, different server instances on the same server listen on different endpoints with different ports. Therefore, the port you specify in the endpoint URL when you specify an availability replica will always direct incoming messages to the server instance whose endpoint is associated with that port.
IIn the endpoint URL, only the number of the port identifies the server instance that is associated with the mirroring endpoint on the target computer. The following figure illustrates the endpoint URLs of two server instances on a single computer. The default instance uses port 7022
and the named instance uses port 7033
. The endpoint URL for these two server instances are, respectively: TCP://MYSYSTEM.Adventure-works.MyDomain.com:7022
and TCP://MYSYSTEM.Adventure-works.MyDomain.com:7033
. Note that the address does not contain the name of the server instance.
To identify the port currently associated with database mirroring endpoint of a server instance, use the following Transact-SQL statement:
SELECT type_desc, port FROM sys.TCP_endpoints
Find the row whose type_desc value is "DATABASE_MIRRORING," and use the corresponding port number.
Note
To use Kerberos authentication for the communication between availability group endpoints, register a Service Principal Name for Kerberos Connections for the database mirroring endpoints used by the AG.
The following endpoint URL specifies a system name, SYSTEM46
, and port 7022
.
TCP://SYSTEM46:7022
The following endpoint URL specifies a fully qualified domain name, DBSERVER8.manufacturing.Adventure-Works.com
, and port 7024
.
TCP://DBSERVER8.manufacturing.Adventure-Works.com:7024
The following endpoint URL specifies an IPv4 address, 10.193.9.134
, and port 7023
.
TCP://10.193.9.134:7023
The following endpoint URL contains an IPv6 address, 2001:4898:23:1002:20f:1fff:feff:b3a3
, and port 7022
.
TCP://[2001:4898:23:1002:20f:1fff:feff:b3a3]:7022
To find the fully qualified domain name of a system, at the Windows command prompt on that system, enter:
IPCONFIG /ALL
To form the fully qualified domain name, concatenate the values of*<host_name>* and <Primary_Dns_Suffix> as follows:
<host_name> . <Primary_Dns_Suffix>
For example, the IP configuration
Host Name . . . . . . : MYSERVER
Primary Dns Suffix . . . : mydomain.Adventure-Works.com
equates to the following fully qualified domain name:
MYSERVER.mydomain.Adventure-Works.com
Note
If you need more information about a fully qualified domain name, see your system administrator.
To Configure a Database Mirroring Endpoint
Create a Database Mirroring Endpoint for Always On Availability Groups (SQL Server PowerShell)
Create a Database Mirroring Endpoint for Windows Authentication (Transact-SQL)
Use Certificates for a Database Mirroring Endpoint (Transact-SQL)
Specify the Endpoint URL When Adding or Modifying an Availability Replica (SQL Server)
Troubleshoot Always On Availability Groups Configuration (SQL Server)
To View Information About the Database Mirroring Endpoint
To add an availability replica
Add a Secondary Replica to an Availability Group (SQL Server)
Join a Secondary Replica to an Availability Group (SQL Server)
Creation and Configuration of Availability Groups (SQL Server)
Overview of Always On Availability Groups (SQL Server)
CREATE ENDPOINT (Transact-SQL)
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Module
Connect an Azure SQL server using an Azure Private Endpoint using the Azure portal - Training
Learn how to securely connect an Azure SQL server using an Azure Private Endpoint via the Azure portal, ensuring private and safe communication with your SQL server.
Certification
Microsoft 365 Certified: Endpoint Administrator Associate - Certifications
Plan and execute an endpoint deployment strategy, using essential elements of modern management, co-management approaches, and Microsoft Intune integration.
Documentation
CREATE AVAILABILITY GROUP (Transact-SQL) - SQL Server
CREATE AVAILABILITY GROUP (Transact-SQL)
Troubleshoot Always On Availability Groups Configuration (SQL Server) - SQL Server Always On
Troubleshoot typical problems with configuring server instances for Always On availability groups in SQL Server.
ALTER AVAILABILITY GROUP (Transact-SQL) - SQL Server
ALTER AVAILABILITY GROUP (Transact-SQL)