Configuring DAG in SQL Server
Configuring DAG in SQL Server
Configuring DAG in SQL Server
--Join Node2 replica and also join databases after joining replica.
ALTER AVAILABILITY GROUP [AG1] JOIN
ALTER AVAILABILITY GROUP [AG1] GRANT CREATE ANY DATABASE
--Create a Listener
USE [master]
GO
ALTER AVAILABILITY GROUP [AG1]
ADD LISTENER N'AGL1' (
WITH IP
((N'10.0.0.6', N'255.255.255.128')
)
, PORT=1433);
GO
--Create listener
USE [master]
GO
ALTER AVAILABILITY GROUP [AG2]
ADD LISTENER N'AGL2' (
WITH IP
((N'10.1.0.6', N'255.255.255.128')
)
, PORT=1433);
GO
--Go to Forwarder (Node3) and join DAG to the Global Primary Replica.
ALTER AVAILABILITY GROUP [distributedag]
JOIN
AVAILABILITY GROUP ON
'AG1' WITH
(
LISTENER_URL = 'TCP://AGL1.anbhu.com:5022',
AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT,
FAILOVER_MODE = MANUAL,
SEEDING_MODE = AUTOMATIC
),
'AG2' WITH
(
LISTENER_URL = 'TCP://AGL2.anbhu.com:5022',
AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT,
FAILOVER_MODE = MANUAL,
SEEDING_MODE = AUTOMATIC
);
GO