When setting up a SQLHA cluster and one of the nodes will not join the Availability Group and you get an error message -
Error:41158,failed to join the availability group
or from the SQL Log file -
- Open SQL Server Configuration Manager.
- Click on SQL Server Services.
- Change the Log On As to the service account (me\admin)
Also verify the port 5022 is open and not blocked. SQLHA uses this port.
Note: This is what fixed the issue for me. If there are additional fixes, please update this KB with the fix that worked for you.
In certain cases permissions or blocked ports can cause issues with SQLHA