-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS RedisCluster not working / get master node failed #64
Comments
@kstrempel I can't reproduce the problem in my dev env so it is hard for me to locate the bug accurately. If you don't mind, could you help me add log about the #!/usr/bin/python
# -*- coding: utf-8 -*-
import asyncio
import logging
from aredis import StrictRedisCluster
async def example():
redis = StrictRedisCluster(startup_nodes=[{'host': '127.0.0.1', 'port': 7001}], decode_responses=False, skip_full_coverage_check=True)
logging.info(redis.connection_pool.initialized)
logging.info(redis.connection_pool.nodes.slots.keys())
logging.info(await redis.get('a'))
logging.info(redis.connection_pool.initialized)
logging.info(redis.connection_pool.nodes.slots.keys())
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
loop = asyncio.get_event_loop()
loop.run_until_complete(example()) In a ideal empty cluster(for example, docker redis cluster in my dev env), output should like below
Looking forward for your response. |
Hello, sorry for the late anser. I run your small testscript against the AWS redis cluster. This is the result
I had to change the connection part a bit.
A AWS you have no 7000, 7001 port for the cluster. |
@kstrempel #!/usr/bin/python
# -*- coding: utf-8 -*-
import asyncio
import logging
from aredis import StrictRedisCluster
async def example():
redis = StrictRedisCluster(startup_nodes=[{'host': '127.0.0.1', 'port': 7001}], decode_responses=False, skip_full_coverage_check=True)
logging.info(redis.connection_pool.initialized)
logging.info(redis.connection_pool.nodes.slots.keys())
await redis.connection_pool.initialize()
logging.info(redis.connection_pool.initialized)
logging.info(redis.connection_pool.nodes.slots[15495])
logging.info(await redis.get('a'))
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
loop = asyncio.get_event_loop()
loop.run_until_complete(example()) |
Here it is.
BTW I forgot to mention that our current solution is running with the |
@kstrempel |
@kstrempel |
I tried that out! It worked! |
@vineetgoel |
We trying to use aredis with a ElasticCache Redis Cluster, but getting the following error.
Our redis client creation is the following:
We using python 3.6 with sanic 0.7.0.
The setup is working with using the redis-py-cluster==1.3.4.
The text was updated successfully, but these errors were encountered: