We recently configured Always On AG group and Listeners , using T-SQL we added a Replica which fails to join the AG Group
Evey time we try to join the AG Group it fails with “The Service Broker endpoint is in disabled or stopped state.” which is unrelated and misleading. To get to the root of the problem we start troubleeting the issue with Endpoints and ports
- Check Mirroring Endpoint exists and LISTENER_PORT is configured
- Check Primary Replica ENDPOINT_URL , the ENDPOINT_URL should be using the same port as Mirroring Endpoint LISTENER_PORT
In our case Mirroring Endpoint was missing from Primary and Secondary Replica. The DBA created the AG group manually which do not check if mirroring endpoint exists or not. The ENDPOINT_URL was configured with a port no which was not he default for Mirroring Endpoint
Primary Replica was configured with a different ENDPOINT other then the default mirroring end point, so we can’t modify it and we don’t want to drop AG group and listener.
So, to fix the issue we removed the secondary Replica from AG Group , dropped Mirroring Endpoint, recreated mirroring endpoint with the port no of Primary Replica ENDPOINT_URL. Add Secondary Replica to the AG group and issues the alter Availability group [AG Name ] join command , which completed successfully.