In trying to setup merge replication between two SQL Server 2008 R2 Servers, the initial error I get is:
The process could not connect to Distributer 'xxxx'
I am getting the following error when setting up the secondary db server to read from db1:
TITLE: View Synchronization Status
The agent could not be started.
------------------------------ ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
SQLServerAgent Error: Request to run job ParentDBServer-TestDb1-TestMerge-publication-BackupDbServer-MergeSubscriberDb1- 0 (from User sa) refused because the job is already running from a request by Start Sequence 0. Changed database context to 'MergeSubscriberDb1'. (Microsoft SQL Server, Error: 22022)
I've installed the latest service packs, etc., and same issue.
Replication monitor on db1 shows all green.
sa accounts on both servers are permitted SQL Server logins.
DTC is successfully running on both servers.
When I open the log viewer, I see SA login failed when selecting Job History and SQL Server Agent, but not DB Mail or SQL Server Agent.
Through Services/SQL Server Agent - I had the agent login credentials set to SA. I changed it to Local System account and restarted.
Both servers are the default instance.
In merge agent security, the first section (the domain or machine account under which the Merge Agent will run) I used db2\sa, and the second section db1\sa.
Incidentally, I setup the publication so that subscribers will act as their own agents. Remembering that I used db2\sa for both, but now I get an error indicating that a subscription with the same name already exists in the subscription db.
I removed the subscription from both servers and ran
sp_removedbreplication on db2.