Adding a source instance and configuring the AlwaysOn availability group

After installing CDC Replication on the SQL Server cluster node that owns the shared disk array, you must add an instance by using the configuration tool.

Procedure

  1. Start the configuration tool and add a new instance that specifies the listener name and listener port for the AlwaysOn availability group.
    Configure the AlwaysOn listener name and port as host and port. Use the same information that was used to create the AlwaysOn availability group.
  2. Switch to the Advanced Configuration tab in the configuration tool and add a list of transaction log backup candidates. CDC Replication connects to these hosts and ports by using the database user to identify the location of the transaction log backups.
  3. In the Transaction Log Backup Directory field, enter the name of the directory that holds the transaction log backups.
    Note: Do not start the instance after you add it.
  4. Run the following command in the \bin folder in your IBM® Data Replication for Microsoft SQL Server installation directory:
    dmcreateclusterservice -I instance_name passive_node_name
    Where passive_node_name is the name of the passive node in the cluster.
  5. Using Windows Failover Cluster Manager, examine the role that was created by Microsoft SQL Server when the AlwaysOn availability group was created. Ensure that the shared clustered disk array where CDC Replication is installed is added as a dependent resource in the availability group role.
  6. Create a new Generic Service resource in the clustered role that contains the availability group for each IBM Data Replication for Microsoft SQL Server instance. Select the IBM CDC Replication service name from the list.

    The CDC Replication service name contains the instance name in the service name. To ensure that the CDC Replication resource depends on the rest of the resources that are in availability group, follow these steps:

    1. Right click the CDC Replication resource that you added to the availability group role and select Properties.
    2. Navigate to the Dependencies tab and add the rest of the resources to the list of dependencies.
    This change ensures that in a failover CDC Replication is the first resource to stop and the last resource to restart. This behavior prevents the disk drive or database from failing over before CDC Replication stops, which reduces the chance of unexpected errors during failover.
  7. Right-click the service name and clear the If restart unsuccessful, fail all resources in this Role check box.

    This step prevents SQL Server from failing over when the CDC Replication service fails or is manually stopped. You could also choose If resource fails, do not restart to prevent automatic restarts of CDC Replication when it is manually stopped. See the Microsoft documentation for more details.

  8. Bring the new cluster resources online.

Results

After you complete this task, CDC Replication will work in an AlwaysOn availability group and support failover of its services. You should also note the following considerations when you use CDC Replication in an AlwaysOn availability group:
  • Subscriptions must be restarted after a failover.
    Note: Persistent subscriptions permit automatic restart of subscriptions after a failover when the failure matches the restart rules of the persistent subscription. For more information see Making subscriptions persistent.
  • All CDC Replication applications such as services, the configuration tool, and command-line utilities must be run from the active node that contains the AlwaysOn availability group definition. Application files are stored on the shared disk and you can only access it on the active node in the cluster.
  • There are no Windows Start menu shortcuts on the passive node.