I have AlwaysOn Availability Groups configured with Replication Subscribers, and is currently running successfully with one publisher using the command below.
-- commands to execute at the publisher, in the publisher database:
EXEC sp_addsubscription @publication = N'yocc_pub',
@subscriber = N'repl_agl',
@destination_db = N'YOCCDB',
@subscription_type = N'Push',
@sync_type = N'automatic', @article = N'all', @update_mode = N'read only', @subscriber_type = 0;
GO
EXEC sp_addpushsubscription_agent @publication = N'yocc_pub',
@subscriber = N'repl_agl',
@subscriber_db = N'YOCCDB',
@job_login = null, @job_password = null, @subscriber_security_mode = 1;
GO
All commands complete successfully.
My first problem is "I want to add one more publisher " to the AlwaysOn subscriber but I am getting the error below:
sql server error-21488 sql server error-18752
Note:-
- node-1 (alwayson primary node and replication subscriber)
- node-2 (secondary replica and report server)
- node-3 (publisher 1)/yocc_pub(work as distributor)
- node-4 (publisher 2)/yocc_pub2(configure successfully but got error-21488,18752)
- listener name - repl_agl
- database - yoccdb
Second problem-
How to maintain primary key value to avoid conflict between publisher 1 and publisher 2 to sync with node-1 because database are same ??