The Database Mirroring Endpoint (SQL Server)
Applies To: SQL Server 2016
To participate in Always On Availability Groups or database mirroring a server instance requires its own, dedicated database mirroring endpoint. This endpoint is a special-purpose endpoint that is used exclusively to receive connections from other server instances. On a given server instance, every Always On Availability Groups or database mirroring connection to any other server instance uses a single database mirroring endpoint.
Database mirroring endpoints use Transmission Control Protocol (TCP) to send and receive messages between the server instances participating database mirroring sessions or hosting availability replicas. The database mirroring endpoint listens on a unique TCP port number.
The network address of a server instance (its server network address or Endpoint URL) contains the port number of its endpoint, as well as the system and domain name of its host computer. The port number uniquely identifies a specific server instance.
The following figure illustrates how two server instances on the same server are uniquely identified. The server network addresses of both server instances contain the same system name,
MYSYSTEM, and domain name,
Adventure-Works.MyDomain.com. To enable the system to route connections to a server instance, a server network address includes the port number associated with the mirroring endpoint of a particular server instance.
By default, an instance of SQL Server does not contain a database mirroring endpoint. These must be created manually as part of setting up a database mirroring session. The system administrator must create a separate endpoint in each server instance that is to participate in database mirroring. Note that if more than one server instance on a given computer requires a database mirroring endpoint, specify a different port number for each endpoint.
For database mirroring and Always On Availability Groups, authentication and encryption are configured on the endpoint. For more information, see Transport Security for Database Mirroring and Always On Availability Groups (SQL Server).
It is important to understand that the SQL Server service accounts of your server instances determine what type of authentication you can use for your database mirroring endpoints, as follows:
If every server instance is running under a domain service account, you can use Windows Authentication for your database mirroring endpoints. If all the server instances run as the same domain user account, the correct user logins exist automatically in both master databases. This simplifies the security configuration for the availability databases and is recommended.
If any server instances that are hosting the availability replicas for an availability group run as different accounts, the login each account must be created in master on the other server instance. Then, that login must be granted CONNECT permissions to connect to the database mirroring endpoint of that server instance. For more information, Set Up Login Accounts for Database Mirroring or Always On Availability Groups (SQL Server).
If your server instances use Windows Authentication, you can create database mirroring endpoints by using Transact-SQL, PowerShell, or the New Availability Group Wizard.
If a server instance that is to host an availability replica lacks a database mirroring endpoint, the New Availability Group Wizard can automatically create a database mirroring endpoint that uses Windows Authentication. For more information, see Use the Availability Group Wizard (SQL Server Management Studio).
If any server instance is running under a built-in account, such as Local System, Local Service, or Network Service, or a nondomain account, you must use certificates for endpoint authentication. If you are using certificates for your database mirroring endpoints, your system administrator must configure each server instance to use certificates on both outbound and inbound connections.
There is no automated method for configuring database mirroring security using certificates. You will need to use either CREATE ENDPOINT Transact-SQL statement or the New-SqlHadrEndpoint PowerShell cmdlet. For more information, see CREATE ENDPOINT (Transact-SQL). For information about enabling certificate authentication on a server instance, see Use Certificates for a Database Mirroring Endpoint (Transact-SQL).
To Configure a Database Mirroring Endpoint
To View Information About the Database Mirroring Endpoint
Transport Security for Database Mirroring and Always On Availability Groups SQL Server)
Troubleshoot Database Mirroring Configuration (SQL Server)