I am at my wits end with this. I am trying to set up mirroring between a development server and my local machine.
The error that keeps coming up is:
Msg 1418, Level 16, State 1, Line 1
The server network address "TCP://machineabc:7023" 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.
Which occurs when I go through the GUI or run
ALTER DATABASE TESTING SET PARTNER = 'TCP://machineabc:7023'
I restored the database first with the .bak
and with no recovery then the .trn
with no recovery. The local database has (Restoring…) next to it…
I have run select * from sys.database_mirroring_endpoints
and it all looks good (Partner, started, both have rc4 encryption).
Any suggestions?
Edit: So I tried again and I did GRANT CONNECT on the access point then when I tried setting the partner I did a net stat and this was the result:
Here are the results of the connectivity tests in Craig Efrein's post:
Best Answer
I got this same error a few weeks ago, despite the fact the connection was fine; it was actually due to an authentication issue.
If you don't have domain connectivity between the two machines, you can use certificates to create credentials that can be used for mirroring endpoints. To do this, you create a certificate on the database on each end, create an endpoint based on the certificate, then export each certificate to the opposite end. The public key in the certificate is thus used to authenticate with the private master key on the remote database.
Create a master encryption key on each server. This is only done once per server instance.
Create a certificate for each instance with an arbitrary subject. I will provide T-SQL for endpoint 1, but you will need to do this on the other endpoint as well.
Create the endpoint using the certificate:
Back up the certificate from each end for export:
Now move each file to the opposite server using your favored method. Here I assume you use the
C:\backup
directory as both source and target on each server.Create server logins, based on the moved files. Note the full credential consists of a server level login and a user credential on the master database. (Kind of strange but that's the way it works...). Here's the code you'd run on endpoint 2 to import the certificate from endpoint 1. The password is totally arbitrary and is not used later. The logins must be granted mirroring rights.
Run a converse process for creating a certificate on endpoint 2 and using it to create a credential on endpoint 1.
Now, it's time to fire up the mirroring. You start with the server whose database is not in recovery mode.
Next run the converse command on the alternate server. (If you get a
database is not configured for mirroring
at this point, there may be an environment-specific security problem that can be worked around with a sysadmin rights grant to the endpoint -- see comment by AllenKing below. This did not occur in our lab.)I ran this process successfully on 2012 SP1 on 21 March. After I corrected an error I made on the account creation -- I did not use master but instead used the mirror database -- everything worked fine.
In troubleshooting configuration, I ended up using the following dynamic views: