dsccommunity / SqlServerDsc

This module contains DSC resources for deployment and configuration of Microsoft SQL Server.
MIT License
358 stars 224 forks source link

SqlReplication: Refactor resource into two resources #1527

Open johlju opened 4 years ago

johlju commented 4 years ago

If the same instance should be both distributor and publisher that does not currently work with the current implementation with SqlServerReplication. Although I have limited knowledge of replication so not sure if there is a limitation here that I'm not aware of but the section here suggest it is possible.

..(in many cases, the Publisher and Distributor are the same server.. https://docs.microsoft.com/en-us/sql/relational-databases/replication/configure-publishing-and-distribution?view=sql-server-ver15#SSMSProcedure

I suggest that the resource SqlServerReplication is refactored into two new resource and removing the resource SqlServerReplication. The two new resource could be named SqlServerDistributor and SqlServerPublisher.

Additional information:

Although this might be an issue if one instance can only be either publisher or distributor.

To configure publishing and distribution on a single server https://docs.microsoft.com/en-us/sql/relational-databases/replication/configure-publishing-and-distribution?view=sql-server-ver15#to-configure-publishing-and-distribution-on-a-single-server

The Distributor is a server that contains the distribution database, which stores metadata and history data for all types of replication and transactions for transactional replication. To set up replication, you must configure a Distributor. Each Publisher can be assigned to only a single Distributor instance, but multiple publishers can share a Distributor. ... By default, the Distributor is the same server as the Publisher (a local Distributor), but it can also be a separate server from the Publisher (a remote Distributor). https://docs.microsoft.com/en-us/sql/relational-databases/replication/configure-distribution?view=sql-server-ver15

The resources should also support this https://docs.microsoft.com/en-us/sql/relational-databases/replication/configure-distribution-availability-group?view=sql-server-ver15

Docs over how to use RMO: https://docs.microsoft.com/en-us/sql/relational-databases/replication/configure-publishing-and-distribution?view=sql-server-ver15#RMOProcedure

johlju commented 4 years ago

This might be used to help create an integration test.

https://docs.microsoft.com/en-us/sql/relational-databases/replication/tutorial-preparing-the-server-for-replication?view=sql-server-ver15