views:

665

answers:

3

I have 2 servers running SQL Server 2005 with merge replication set up between them.

Each server is connected to the building network, but they also have a cross-over cable connecting them creating a private network.

How do I configure merge replication so it uses the private network and not the building network?

The private network is not part of any domain, but the building network may or may not have a domain depending on the client.

I tried setting up replication using the private network IP addresses, but some of the stored procedures only work with a windows server name. I imagine that server name could resolve over either network, and I want to prevent replication traffic from being sent on the building network.

+1  A: 

I don't know if this will work, but it's worth a try.

  • Make sure the crossover cable is set up as a private subnet between the machines. The IP addresses associated with each endpoint must have a common prefix which is different from the building network's. For example, set one endpoint to 192.168.24.1 and the other one to 192.168.24.2, and the subnet mask on both to 255.255.255.0.

  • Add these IP addresses to the hosts file \WINDOWS\system32\drivers\etc\hosts. Make sure you use different server names than the existing ones. I've used server1 and server2 below.

    192.168.24.1 server1

    192.168.24.2 server2

Test using

   ping server1
   ping server2

to make sure they can talk to each other.

Use the server1 and server2 names to configure replication.

Carlos A. Ibarra
Unfortunately this didn't work. I get the following error on the subscriber: "The remote server "ReplicationPrimary" does not exist, or has not been designated as a valid Publisher, or you may not have permission to see available Publishers."
Eric Lathrop
I also had an error setting up a publisher with sp_adddistributor:"Could not connect to server 'TEST-SERVER' because 'distributor_admin' is not defined as a remote login at the server. Verify that you have specified the correct login name."
Eric Lathrop
Another alternative may be to set a static route with ROUTE -p ADD 10.2.3.4 MASK 255.255.255.255 192.168.24.1 METRIC 0. Here 10.2.3.4 is the IP address of the other machine on the building network. Do the same (backwards) on the other node. Use the regular names for replication.
Carlos A. Ibarra
Actually, I did get it working this way. The first time I set it up, I put _new_ server names in the hosts file, and used those setting up replication. You need to add the same windows computer names in the hosts file for it to work. Much thanks!
Eric Lathrop
A: 

Here is a guess. Maybe SQL isn't listening on that IP.

Go to SQL Server configuration manager > SQL2005 network configuration > TCP/IP properties > Add IP(x) for your local network

SQL will also say what IP/ports it is listening on in the log on startup.

Sam
A: 

thinkcube's answer was correct except for a detail I want to share here in case people don't read the comments:

Make sure you use different server names than the existing ones.

I needed to use the same server name in the hosts file. This is because the publisher required the windows server name, while the subscriber was okay with something else.

Since windows looks in the hosts file first, the IP address (on the private network) will be used, but the publisher will still see the correct name.

Eric Lathrop