Configure SRM for Failover and Failback

Learn how to configure SRM for failover and failback.

To prepare for a failover or failback scenario you have to set up SRM with bidirectional replication. Additionally, you have to make sure that all mission critical topics and consumer groups are whitelisted on both the primary and backup clusters.

  1. Set up bidirectional replication between clusters:

    Configure the following configuration properties based on your environment.

    # Specify clusters and add connection information
    
    clusters = primary, secondary
    primary.bootstrap.servers = primary_host1:9092, primary_host2:9092, primary_host3:9092
    secondary.bootstrap.servers = secondary_host1:9092, secondary_host2:9092, secondary_host3:9092
    
    # Enable bidirectional replication 
    
    primary->secondary.enabled = true
    secondary->primary.enabled = true
    
  2. Whitelist required consumer groups and topics on the primary cluster.
    1. Whitelist groups:
      srm-control groups --source [PRIMARY_CLUSTER] --target [SECONDARY_CLUSTER] --add [GROUP1],[GROUP2]
    1. Whitelist topics:
      srm-control topics --source [PRIMARY_CLUSTER] --target [SECONDARY_CLUSTER] --add [TOPIC1],[TOPIC2]
  3. Whitelist required remote topics and consumer groups on the secondary cluster.
    1. Whitelist remote groups:
      srm-control groups --source [SECONDARY_CLUSTER] --target [PRIMARY_CLUSTER] --add [GROUP1],[GROUP2]
      
    2. Whitelist remote topics:
      srm-control topics --source [SECONDARY_CLUSTER] --target [PRIMARY_CLUSTER] --add [PRIMARY_CLUSTER.TOPIC1],[PRIMARY_CLUSTER.TOPIC2]
  4. Verify that all required topics and consumer groups are whitelisted.
    1. Verify consumer groups:
      srm-control groups --source [PRIMARY_CLUSTER] --target [SECONDARY_CLUSTER] --list
      srm-control groups --source [SECONDARY_CLUSTER] --target [PRIMARY_CLUSTER] --list
      
    2. Verify topics:
      srm-control groups --source [PRIMARY_CLUSTER] --target [SECONDARY_CLUSTER] --list
      srm-control topics --source [SECONDARY_CLUSTER] --target [PRIMARY_CLUSTER] --list
      

SRM is set up with bidirectional replication and all mission critical topics and consumer groups are whitelisted on both the primary and secondary clusters.