dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.23k stars 908 forks source link

Support for replica-announce-ip and replica-announce-port #3380

Closed romange closed 1 month ago

romange commented 1 month ago

We host our Redis pods in K8s When Redis replicates with a master, Redis uses the pod IP to "name" the replica Pod IPs are ephemeral, when the pod is bounced, it comes up with a new IP This is problematic for Redis Sentinel because as pods are bounced, it sees a new IP address for the previous replica and creates a bloated list of "dead replicas" Redis Sentinel should not have any dead replicas, so the command sentinel reset SHARD_NAME removes them - however executing this after each pod cycle is toilsome We mitigate this in K8s by provisioning a K8s Service with a ClusterIP Our helm-chart has an init container which discovers the ClusterIP for the StatefulSet Pod, and sets replica-announce-ip to this value Redis then advertises itself as being available at that IP address

romange commented 1 month ago

Need to see if it is possible to merge cluster_announce_ip and replica_announce_ip. seems that they both serve the same purpose - to announce an external ip, not visible to Dragonfly process