gpt4 book ai didi

python-3.x - Redis Cluster 是否支持使用 Python API 的连接池?

转载 作者:行者123 更新时间:2023-12-03 22:32:37 32 4
gpt4 key购买 nike

Redis Cluster 是否支持使用 python api“rediscluster”的连接池?
我已经搜索过,但找不到合适的链接。
如果python api支持连接池,有人可以共享代码或链接吗?

谢谢你,
萨钦维亚​​斯

最佳答案

如果您检查 rediscluster's page在 PyPI 上,您会发现此注释:

rediscluster-py is based on the awesome redis-py StrictRedis Api, thus the original api commands would work without problems within the context of a cluster of redis servers



所以你可以依靠 redis-py用于连接池的 API:
pool = redis.ConnectionPool(host='localhost', port=6379, db=0)
r = redis.Redis(connection_pool=pool)

关于python-3.x - Redis Cluster 是否支持使用 Python API 的连接池?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57920849/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com