I have a working redis sentinel. I can connect to it with python code and ping it without issue (code below). However when I try to connect my celery application to this redis sentinel, I get back no master found for 'mymaster'. I probably have some settings wrong? both my master and my sentinel are protected by password. I am running it in Openshift, though I am not sure it is relevant as the sentinel is accessible by the python code from a different pod (and service).
redis-cli -p 26379 -h 192.168.7.248
192.168.7.248:26379> auth abc
OK
192.168.7.248:26379> info sentinel
# Sentinel
sentinel_masters:1
sentinel_tilt:0
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
sentinel_simulate_failure_flags:0
master0:name=mymaster,status=ok,address=192.168.18.36:6379,slaves=0,sentinels=1
import redis
from redis.sentinel import Sentinel
sentinel = Sentinel([('192.168.7.248', 26379)], sentinel_kwargs={'password': 'abc'})
host, port = sentinel.discover_master("mymaster")
redis_client = redis.StrictRedis(
host=host,
port=port,
password='abc'
)
print(redis_client.ping())
This code prints out "True".
My celery app:
from celery import Celery
app = Celery("app_celery")
options = {
"master_name": "mymaster",
"sentinel_kwargs": {"password": "abc"},
}
app.conf.broker_url = "sentinel://192.168.7.248:26379"
app.conf.broker_transport_options = options
I am absolutely desperate, any help would be really appreciated.