I'm facing a MasterNotFoundError when I try to connect to the master node by following the deployment guide here: https://docs.bitnami.com/tutorials/deploy-redis-sentinel-production-cluster/
My code to connect to the master Redis Sentinel node is:
from redis.sentinel import Sentinel
redis_host = 'redis.default.svc.cluster.local'
redis_port = 26379
sentinel = Sentinel([(redis_host, redis_port)], socket_timeout=0.1, password='abc')
redis_client = sentinel.master_for('mymaster', password='abc')
In their GitHub repo, I see that the config for sentinel.masterSet is set to mymaster by default. But when I try to increment using the code below:
redis_client.incr('counter', 1)
I face the redis.sentinel.MasterNotFoundError: No master found for 'mymaster' error.
How can I solve this? Thanks.