{
  "schema_version": 2,
  "id": "integrate/redis-data-integration/installation/ha-test",
  "title": "Test HA failover",
  "url": "https://redis.io/docs/latest/integrate/redis-data-integration/1.19.1/installation/ha-test/",
  "summary": "Learn how to perform HA failover testing for Redis Data Integration (RDI) to ensure high availability and reliability of your data integration setup.",
  "content": "\n## Setup\n1. Ensure that RDI is up and running on both primary and secondary nodes.\n   Run the following command and verify and that each instance should show healthy and running `rdi-api` and `rdi-operator` pods.\n```\nkubectl -n rdi get pods\n\n# Example output:\nNAME                                   READY   STATUS      RESTARTS      AGE\ncollector-api-577d95bfd8-5wbg6         1/1     Running     0             12m\ncollector-source-95f45bcf7-vwn5l       1/1     Running     0             12m\nfluentd-zq2lc                          1/1     Running     0             72m\nlogrotate-29530445-j729x               0/1     Completed   0             14m\nlogrotate-29530450-dprr2               0/1     Completed   0             9m40s\nlogrotate-29530455-mfmzw               0/1     Completed   0             4m40s\nprocessor-f66655469-h7nw2              1/1     Running     0             12m\nrdi-api-f75df6796-qwqjw                1/1     Running     0             72m\nrdi-metrics-exporter-d57cdf8c8-wjzb5   1/1     Running     0             72m\nrdi-operator-7f7f6c7dfd-5qmjd          1/1     Running     0             71m\nrdi-reloader-77df5f7854-lwmvz          1/1     Running     0             71m\n```\n\n2. Identify the leader node - this is the one that has a running `collector-source` pod.\n\n## Performing the HA Failover Testing\n\nTo perform HA, you can simulate a connection failure between the leader and the RDI database by blocking the network traffic. You can do this by running the following commands on the leader node:\n\n1. Identify the RDI database IP (replace `\u003chostname\u003e` with your own hostname):\n```\ndig +short \u003chostname\u003e\n\n# Example:\n# dig +short my.redis.hostname.com\n\n# Example output:\n54.78.220.161\n```\n\n2. For each of the IPs returned by the above command, run the following command to block the traffic:\n\n```\nsudo iptables -I FORWARD -d \u003cdatabase_ip\u003e -j DROP\n\n# With the IP from the example above, the command would be:\nsudo iptables -I FORWARD -d 54.78.220.161 -j DROP\n```\n\n\nThe default configuration for the leader lock is 60 seconds, so it may take up to 2 minutes for the failover to occur.\nMeanwhile you can follow the logs of the operator to see the failover process:\n\n```\nkubectl -n rdi logs rdi-operator-7f7f6c7dfd-5qmjd -f\n```\n\nIn about 10 seconds you will start seeing log entries from the leader saying that it could not acquire the leadership.\nWhen the leader lock expires, the second node will acquire the leadership and you will see log entries from the second node indicating that it has become the leader.\n\n## Cleanup\n\nTo clean up after the test, remove the `iptables` rule that you added to block the traffic:\n\n```sudo iptables -D FORWARD -d \u003cdatabse_ip\u003e -j DROP```\n\nUse `sudo iptables -S | grep \u003cdatabase_ip\u003e` to verify that the rule has been removed.\n",
  "tags": ["docs","integrate","rs","rdi"],
  "last_updated": "2026-09-19T17:55:58-07:00"
}
