March 26, 2019 at 11:15 am
Hi All,
Say I have two datacenters. Each one has two instances of SQL Server. The pairs use transactional replication between the two at each datacenter. DC1 is the primary and DC2 would be the secondary. SO like:
DC1: SQL1 -> SQL2
DC2: SQL3 -> SQL4
Now what I'd like to know is if SQL1 and SQL3 are part of the same AG and SQL2 and SQL4 are part of their own AG, is there any way to get replication to function at DC2? I understand that DC2's databases would be in standby mode because they're secondary. If SQL3 and SQL4 both become the primary and replication was already setup on it before being part of the availability group, would replication just start back up and be happy or would it need to be set back up? Would this setup even be possible?
I think the part that confuses my search elsewhere is that we only have 2016 Standard and a lot of features mentioned seem to be Enterprise only.
Thanks everyone
March 26, 2019 at 11:49 pm
You can configure an Always On database as a Publisher or a Subscriber in a transactional replication topology and they automatically handle failover. See here for more info.
So in essence, AG1 (SQL1 and SQL3 replicas) would be configured as your Publisher and AG2 (SQL2 and SQL4 replicas) would be configured as your Subcriber.
Provided you have configured your publisher and subscriber correctly, you would not encounter any issues following failover, replication should start up and continue functioning like normal post-failover.
IMPORTANT: The distribution database is not supported in an AlwaysOn AG until recently - https://blogs.msdn.microsoft.com/sql_server_team/replication-enhancement-distribution-database-in-availability-group/
March 27, 2019 at 10:38 am
Thanks HandyD,
I can't believe I missed these articles. Your four scenarios are exactly what I want to account for. The only other question is whether this is all truly supported in Standard edition.
Beatrix, thank you also. I'll review that trace and see if its appropriate. I guess if there are no down sides I'll just turn it on.
I'll follow up here with my test results.
Thanks again.
March 27, 2019 at 6:00 pm
Replication and AlwaysOn should be fully supported in Standard Edition. See here and here.
There are some caveats and design decisions that are important. For example, as per Docs:
For transactional replication push subscribers, the distribution agent will continue to replicate automatically after a failover if the subscription was created using the AG listener name. For transactional replication pull subscribers, the distribution agent will continue to replicate automatically after a failover, if the subscription was created using the AG listener name and the original subscriber server is up and running.
So for this reason, you would probably want to go with Push subscriptions to simplify things.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply