You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Policy Name**: Availability Replica Connection State
23
-
-**Issue**: Availability replica is disconnected.
24
+
-**Issue**: Availability replica is disconnected
24
25
-**Category**: **Critical**
25
-
-**Facet**: Availability replica
26
-
27
-
## Description
28
-
29
-
This policy checks the connection state between availability replicas. The policy is in an unhealthy state when the connection state of the availability replica is DISCONNECTED. The policy is otherwise in a healthy state.
30
-
31
-
## Possible Causes
32
-
33
-
The secondary replica isn't connected to the primary replica. The connected state is DISCONNECTED. This issue can be caused by the following:
34
-
35
-
- The connection port might be in conflict with another application.
36
-
37
-
- The encryption type or algorithm is mismatched.
38
-
39
-
- The connection endpoint has been deleted or hasn't been started.
40
-
41
-
- There are network/connectivity issues or Ports are blocked at the firewall.
42
-
43
-
- Service/startup account isn't a domain user and isn't able to connect to the DC and to the remote node and port (for example, 5022)
44
-
45
-
## Possible Solutions
46
-
47
-
Check the database mirroring endpoint configuration for the instances of the primary and secondary replica and update the mismatched configuration. Also, check if the port is conflicting, and if so, change the port number.
48
-
49
-
The following are possible solutions for this issue:
50
-
51
-
- The connection port might be in conflict with another application.
52
-
53
-
Run the following commands to diagnose port issue:
54
-
55
-
```PowerShell
56
-
$server_name = "server_instance" #replace with your SQL Server instance
57
-
Sqlcmd -S $server_name -E -Q "SELECT type_desc, port FROM sys.tcp_endpoints WHERE type_desc = 'DATABASE_MIRRORING'; "
58
-
```
59
-
The above command will return the port number that you have to use in below command.
60
-
61
-
```PowerShell
62
-
$port = "5022"
63
-
Get-NetTCPConnection -LocalPort $port
64
-
Get-Process -Id (Get-NetTCPConnection -LocalPort $port).OwningProcess |Select-Object Name, ProductVersion, Path, Id
65
-
```
26
+
-**Facet**: Availability replica
66
27
67
-
- The encryption type or algorithm is mismatched.
28
+
## Description
68
29
69
-
Run this on both servers and compare the encryption and make sure both are same:
30
+
This policy checks the connection state between availability replicas. The policy is in an unhealthy state when the connection state of the availability replica is `DISCONNECTED`. The policy is otherwise in a healthy state.
70
31
71
-
```PowerShell
72
-
$server_name = "server_instance" #replace with your SQL Server instance
The secondary replica isn't connected to the primary replica. The connected state is `DISCONNECTED`. This issue can be caused by one of the following reasons:
35
+
36
+
-[The connection port might be in conflict with another application](#the-connection-port-might-be-in-conflict-with-another-application).
37
+
-[The encryption type or algorithm is mismatched](#the-encryption-type-or-algorithm-is-mismatched).
38
+
-[The connection endpoint was deleted or isn't started](#the-connection-endpoint-was-deleted-or-isnt-started).
39
+
-[There are network/connectivity issues or Ports are blocked at the firewall](#network-or-connectivity-issues-or-ports-are-blocked-at-the-firewall).
40
+
-[Service/startup account isn't a domain user and isn't able to connect to the DC and to the remote node and port (for example, 5022)](#account-isnt-a-domain-user-and-cant-connect-to-the-dc-and-to-the-remote-node).
41
+
42
+
## Possible solutions
43
+
44
+
Check the database mirroring endpoint configuration for the instances of the primary and secondary replica and update the mismatched configuration. Also, check if the port is conflicting, and if so, change the port number.
45
+
46
+
The following are possible solutions for this issue:
47
+
48
+
#### The connection port might be in conflict with another application
49
+
50
+
Run the following commands to diagnose port issues:
51
+
52
+
```powershell
53
+
$server_name = "server_instance" #replace with your SQL Server instance
54
+
sqlcmd -S $server_name -E -Q "SELECT type_desc, port FROM sys.tcp_endpoints WHERE type_desc = 'DATABASE_MIRRORING'; "
55
+
```
56
+
57
+
The previous command returns the port number that you have to use in the following command.
#### Account isn't a domain user and can't connect to the DC, and to the remote node
106
+
107
+
To test whether the service account can connect to the remote node, follow these steps. The steps assume that you aren't logged in with the service account.
108
+
109
+
1. Select **Start** > **Windows PowerShell** > right-click the icon.
110
+
111
+
1. Select **More** > **Run as Different User** > **Use a different account**.
112
+
113
+
1. Type the service account name and password.
114
+
115
+
1. After Windows PowerShell opens, type the following command to verify that you signed in with the service account:
116
+
117
+
```powershell
118
+
whoami
83
119
```
84
120
85
-
Run the below command if you suspect that endpoint is not responding to connections or is not running.
86
-
87
-
88
-
```PowerShell
89
-
$server_name = "server_instance" #use your SQL Server instance here
90
-
$server_name = "hadr_endpoint" #replace with your endpoint name
- Service/startup account is not a domain user and is not able to connect to the DC and to the remote node and port (for example, 5022)
110
-
111
-
To test whether the service account can connect to the remote node, follow these steps. The steps assume that you are not logged in with the service account:
112
-
113
-
1. Select **Start** > **Windows PowerShell** > right-click the icon.
114
-
1. Select **More** > **Run as Different User** > **Use a different account**.
115
-
1. Type the service account name and password.
116
-
1. After Windows PowerShell opens, type the following command to verify you've logged in with the service account:
117
-
118
-
```PowerShell
119
-
whoami
120
-
```
121
-
122
-
1. Then you can test the connection to the remote node. For example:
123
-
124
-
```PowerShell
125
-
$computer = "remote_node" # Replace with node name in your environment.
126
-
$port = "5022" # Replace with the port from your database_mirroring_endpoints.
- [Overview of Always On Availability Groups (SQL Server)](../../../database-engine/availability-groups/windows/overview-of-always-on-availability-groups-sql-server.md)
132
-
- [Use the Always On Dashboard (SQL Server Management Studio)](../../../database-engine/availability-groups/windows/use-the-always-on-dashboard-sql-server-management-studio.md)
133
-
134
-
129
+
## Related content
130
+
131
+
-[What is an Always On availability group?](overview-of-always-on-availability-groups-sql-server.md)
132
+
-[Use the Always On Availability Group dashboard (SQL Server Management Studio)](use-the-always-on-dashboard-sql-server-management-studio.md)
0 commit comments