dhilipkumars / redis-sentinel-micro

Minimalistic redis sentinel process only to do slave promoton
Apache License 2.0
19 stars 4 forks source link

what is the way to connect to the master? #1

Open veeramarni opened 6 years ago

veeramarni commented 6 years ago

I use helm repo redis-cache that uses this docker image. The issue we noticing was when we only give one URL for redis, it will fail if that serving a slave with error READONLY slave. Can you tell us what should we give to connect to redis master all the time?

We use the settings showing in the following file and it fails with Last error: ERR unknown command 'sentinel' https://github.com/luin/ioredis#sentinel

dhilipkumars commented 6 years ago

Hi @veeramarni , this is not a full fledged sentinel (not a running service), it is only invoked when a master-slave promotion is required by K8s statefulset controller.

you need to do this on any redis-server (withing this master / slave) setup $info replication which will give you the new elected master and start using that

blaw2422 commented 5 years ago

@veeramarni , one way to do what you need is to put the sentinel command in a loop on a running container.