Running Redis in an active-active pattern keeps cache endpoints available during node maintenance and allows client traffic to be spread across more than one node instead of relying on a single primary instance.
A Pacemaker cluster managed with pcs controls services as resources, starts and stops them via systemd, and monitors health to restart or recover failed instances. Cloning a resource tells Pacemaker to run the same service on multiple nodes at the same time, with placement rules enforcing limits such as one instance per node.
Cloning a service only manages processes and placement, not data consistency or multi-writer replication. Confirm a Redis design that supports multi-node access (for example Redis Cluster or a vendor active-active implementation), and verify client routing, authentication, persistence, and firewall rules before placing the service under pcs control.
Steps to set up Redis active-active with PCS:
- Confirm the cluster is online and has quorum.
$ sudo pcs status Cluster name: clustername Cluster Summary: * Stack: corosync (Pacemaker is running) * Current DC: node-01 (version 2.1.6-6fdc9deea29) - partition with quorum * 3 nodes configured * 0 resource instances configured ##### snipped #####
- Identify the Redis systemd unit name to manage.
$ systemctl list-unit-files --type=service | grep -E '^(redis|redis-server)\.service' redis-server.service disabled enabled
- Stop and disable the Redis unit outside Pacemaker on each node.
$ sudo systemctl disable --now redis-server.service Synchronizing state of redis-server.service with SysV service script with /usr/lib/systemd/systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install disable redis-server ##### snipped #####
Stopping Redis immediately disconnects current clients on that node.
- Create the Redis service resource in pcs using the identified unit.
$ sudo pcs resource create redis_service systemd:redis-server op monitor interval=30s
Use systemd:redis when the unit name is redis.service.
Related: How to create a Pacemaker resource
- Clone the Redis service resource across nodes.
$ sudo pcs resource clone redis_service
Cloning a standalone Redis configuration does not create shared state and can lead to inconsistent keys across nodes.
- Verify the cloned resource is started on the expected nodes.
$ sudo pcs status resources * Clone Set: redis_service-clone [redis_service]: * Started: [ node-01 node-02 node-03 ] - Update client routing to distribute traffic across active nodes.
Use a load balancer or DNS strategy that removes unhealthy nodes and matches the chosen Redis topology.
- Verify each active node responds to a basic Redis request.
$ redis-cli -h node-01 PING PONG $ redis-cli -h node-02 PING PONG
Add -p <port> for a non-default port and -a <password> when authentication is enabled.
- Run a failover test after distribution is updated.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
