Article ID: 321822 - View products that this article applies to.
This article was previously published under Q321822
Set Up Replication Between Two Computers Running SQL ServerConsider the following two issues when you set up replication between two computers running SQL Server.
Security Context of the Replication AgentYou can configure the replication agent (including Log Reader Agent, the Merge Agent, the Distribution Agent, and the Snapshot Agent):
Default Client Net-LibraryStarting with SQL Server 2000 (Microsoft Data Access Component [MDAC] 2.6), the default client Net-Library is set to TCP/IP. In earlier versions of SQL Server, the default client Net-Library is set to named pipes. If the client computer uses Named Pipes to communicate to the server by using an alias or because the client is running an earlier version of MDAC, and the servers are in trusted domains, the executable file of the replication agent creates a named pipe (a file at the operating system level) on the destination server to establish a connection.
The executable file creates a named pipe by using the security context of the SQL Server Agent account on the source server. If the destination server cannot verify the credentials of this account, the connection is not successful, and you receive the following error message:
For more detailed information about this error message, Microsoft recommends that you try to establish a connection from the source server to the destination server by using a tool such as Isql.exe of the ODBC DSN Wizard. You will receive an operating system-level error message that is similar to one of the following error messages:
SQL server does not exist or access is denied.
If you use TCP/IP, the connection is established by using the Winsock API calls that are made by using the sockets network library. The connection establishes an underlying TCP session by using the TCP three-way handshake protocol. The client computer opens a source port and communicates to a destination port.
Problems If You Use an IP Address to Configure Replication
If you try to register the server (Publisher or the Subscriber) by using an IP address instead of a client alias, or if the client alias is different from the actual SQL Server NetBIOS name, the Merge Agent may fail, and you receive the following error messages:
Set Up Replication Between Two Computers Running SQL Server Across the Internet
Example 1: The Subscriber Has Schema and Data, and the Initial Snapshot Is Not Necessary.
To pull the subscription, create an alias for the Publisher at the Subscriber, and then follow these steps:
Example 2: The Subscriber Does Not Have the Schema and Data, and the Initial Subscription from the Publisher Is Required.This example requires you to configure the FTP service at the Publisher, and then configure the Subscriber to download the initial snapshot from the FTP site. For more information, see the following topics in SQL Server Books Online:
Use Windows Authentication to Set Up Replication Between Two Computers Running SQL Server in Non-Trusted Domains
If you have to set up replication across two non-trusted domains or workgroups by using Windows authentication, you must configure pass-through authentication. Configure a local Windows account on both the Publisher and the Subscriber that has the same name and password. After you configure this account, use the account to start the SQL Server Agent service on the Publisher for push subscriptions and on the Subscriber for pull subscriptions. Make sure that this account is configured according to the "Setting up Windows Services Accounts" topic in SQL Server Books Online.
If the user tries to make a network connection to a remote computer that is in a non-trusted domain, the logon proceeds as if the user is connecting to an account on the remote computer. The remote computer authenticates the logon credentials against its directory database. If the account is not defined in the directory database, but the guest account on the remote computer is enabled and the guest account has no password set, the user logs on with guest permissions. If the guest account is not enabled, the logon is not successful.
Important In the previous examples, if there is a firewall between the two servers, make sure that the firewall is configured according to the following article:
(https://support.microsoft.com/kb/287932/EN-US/ )INF: TCP Ports Needed for Communication to SQL Server Through a Firewall
For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
(https://support.microsoft.com/kb/320499/EN-US/ )HOW TO: Manually Synchronize Replication Subscriptions by Using Backup or Restore
(https://support.microsoft.com/kb/312292/EN-US/ )HOW TO: Enable Replication Agents for Logging to Output Files in SQL Server
(https://support.microsoft.com/kb/299903/EN-US/ )FIX: sp_scriptpublicationcustomprocs Generates Replication Stored Procedures
Article ID: 321822 - Last Review: January 10, 2006 - Revision: 3.8