redis-sentinel-micro icon indicating copy to clipboard operation
redis-sentinel-micro copied to clipboard

what is the way to connect to the master?

Open veeramarni opened this issue 6 years ago • 2 comments

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

veeramarni avatar Oct 11 '18 12:10 veeramarni

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

dhilipkumars avatar Oct 11 '18 13:10 dhilipkumars

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

blaw2422 avatar Oct 30 '18 02:10 blaw2422