I was setting up database mirroring, here is my model:
I was setting up mirroring with certificate, it is ok when I set Principal and Mirror see together.
But when I add Witness for Principal, I got an error:
"The ALTER DATABASE command could not be sent to the remote server instance 'TCP://xxx:5024'. The database mirroring configuration was not changed. Verify that the server is connected, and try again."
Notice that I was setting up the correct certificate for Principal, Mirror and Witness And the Principal can telnet to Witness via 5024 port.
I have been searching on the internet for two weeks but it seems there is no complete answer.
I spent one day to figure out this issue and this thread Trouble setting up witness in SQL Server mirroring scheme w/ error saved me.
My problem is the Witness server does not see the Principal server. I went through the Windows Event in Witness server and see this:
The mirroring connection to "TCP://xx:6022" has timed out for database "xxx" after 10 seconds without a response. Check the service and network connections.
And I add a host entry point to Principle server on Witness server and problem solved.