Are you using any custom parameters or values?
\nI'm sure about every parameter because without auth, script works as expected, the only parameter I cannot trust is password in sentinel_kwargs. I'm also sure that problem is on dogpile.cache because from the same client it works with redis-cli or with a python script like this:
import redis\n\n# Create a Redis Sentinel connection\nsentinel = redis.Redis(\n host='redis-cluster',\n port=26379,\n password='mypassword',\n decode_responses=True\n)\n\n# Get the replicas (slaves) of the master\nreplicas = sentinel.sentinel_slaves('mymaster')\n\n# Iterate through replicas and print their IP and port\nfor replica in replicas:\n replica_host = replica['ip']\n replica_port = replica['port']\n print(f\"Replica: {replica_host}:{replica_port}\")\n
What is the expected behavior?
\nsame output obtained when auth is disabled:
\n5.0.1
\nData found in cache: <dogpile.cache.api.NoValue object>
\nFinal result: <dogpile.cache.api.NoValue object>
What do you see instead?
\nredis.sentinel.SlaveNotFoundError: No slave found for 'mymaster
Additional information
\nRedis cluster is deployed through bitnami helm chart.
\nI've tried different version of dogpile.cache (1.1.8 and 1.1.0), same result.
I've tried to add decode_responses parameter, same result.
\nNetwork and name resolution are ok. It works without auth and with auth enable but without dogpile.cache (like redis-cli and redis-py).
fixed adding also connection kwargs. sentinel password is used to connect to sentinel but to connect to the master node connection kwargs has to be set. If user is default, username field can be omitted.
\ncache_region = dogpile.cache.make_region().configure(
\n'dogpile.cache.redis_sentinel',
\narguments={
\n'sentinels': [
\n['redis-cluster', 26379],
\n],
\n'sentinel_kwargs': {
\n'password': 'mypassword',
\n}
\n'connection_kwargs': {
\n'password': 'mypassword',
\n}
\n}
\n)
-
Name and Version What steps will reproduce the bug? Deploy a Redis cluster with sentinel and auth enabled, create a script to call sentinel host and retrieve data from cache:
Are you using any custom parameters or values?
What is the expected behavior? What do you see instead? Additional information I've tried to add decode_responses parameter, same result. |
Beta Was this translation helpful? Give feedback.
-
hi - unfortunately I know nothing about this driver or what might be causing your problem. can you perhaps inspect and/or debug the source code for dogpile's connector directly to see what parameters are not being passed in the way expected? in particular I notice you are using a parameter "decode_responses", that we dont seem to have. thanks |
Beta Was this translation helpful? Give feedback.
-
fixed adding also connection kwargs. sentinel password is used to connect to sentinel but to connect to the master node connection kwargs has to be set. If user is default, username field can be omitted. cache_region = dogpile.cache.make_region().configure( |
Beta Was this translation helpful? Give feedback.
fixed adding also connection kwargs. sentinel password is used to connect to sentinel but to connect to the master node connection kwargs has to be set. If user is default, username field can be omitted.
cache_region = dogpile.cache.make_region().configure(
'dogpile.cache.redis_sentinel',
arguments={
'sentinels': [
['redis-cluster', 26379],
],
'sentinel_kwargs': {
'password': 'mypassword',
}
'connection_kwargs': {
'password': 'mypassword',
}
}
)