I created an availability group (two nodes) , then my secondary replica isn't connected like on the picture. I verified on error logs and i have this error . how can I give permission to my secondary replica ? thank you.
2 Answers
The AG are using "Database Mirroring" Endpoint to communicate between all nodes. Your SQL Service account need to have "connect" permission on the endpoint. You also need to grant "ConnectSQL" to the other node service account (or the Server - AITS\PLSBDATEST2$- if using local service account).
So to recap, on PLSBDATEST1, you will have a login for PLSBDATEST2$ and you will grant permission to the AG endpoint to it. on PLSBDATEST2, you will have a login for PLSBDATEST1$ with same permission.
That should do the job.
The account that is listed in the error message is the Active Directory computer account. If possible, your best solution is to reinstall SQL Server on all nodes and use the same AD account for the SQL Server service.
If you can't do that, create a login on the secondary(s) for AITS\PLSBDATEST2$ and add it to the sysadmin role.