I am trying to set up High Safety Mirroring without automatic failover in 2 EC2 instances for my client.
These instances run on 64 bit Windows Server 2012 R2 and have SQL Server 2014 Standard Edition.
While creating the second EC2 instance the hostname was identical to the the first EC2 instance. The system administrator changed the name of the host so that Principal and Mirror have different hostnames.
I used sp_addserver to change the name of the instance to match the host name and dropped all rows from the sys.sysservers in the Mirror instance.
Now when I try to start mirroring I get the error "The server network address "....." can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. (.Net SqlClient Data Provider)" and the mirror database's status changes to 'In Recovery' from 'Restoring'
I was using port 5022 so verified that the port was open and listening. Also Windows firewall has been turned off on both the instance. I am able to connect to Mirror from Principal using the hostname of Mirror from Management Studio and Vice Versa. Even I the t-sql statement
ALTER DATABASE [<dbname>] SET PARTNER = 'TCP://<PrincipalHostname>:5022'
runs fine on Mirror.
Its when I run the statement
ALTER DATABASE [<dbname>] SET PARTNER = 'TCP://<MirrorHostname>:5022'
I get the error.
I tried the steps listed in https://social.msdn.microsoft.com/Forums/sqlserver/en-US/71961bdf-a9f3-4cb6-84ef-cb2e3afd6194/database-status-principal-disconnected-network-address-can-not-be-reached?forum=sqldisasterrecovery but wasn't able to set up mirroring.
I asked my sysadmin to create a separate EC2 instance so that I can configure mirroring over there. The new Mirror instance that was created allows me to connect to the Mirror from Principal(and vice versa) using Private IP and Not hostname. This time I get the same error while trying to execute the statement on the Mirror
ALTER DATABASE [<dbname>] SET PARTNER = 'TCP://<PrincipalIP>:5022'
The following statement executes successfully in the Principal
ALTER DATABASE [<dbname>] SET PARTNER = 'TCP://<MirrorIP>:5022'
Please share some ideas to resolve this.
Prasenjit Gupta DBA Tata Consultancy Services Ltd.