使用pip search查看可安装的Redis模块版本
PS D:\code>pip install pip-search #安装pip-search模块
PS D:\code> pip_search redis #利用pip-search查找模块可安装的版本信息
🐍 https://pypi.org/search/?q=redis 🐍
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Package ┃ Version ┃ Released ┃ Description ┃
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 📂 redis2 │ 2.10.6.3 │ Jan 1, 2022 │ Python client for Redis key-value store │
│ 📂 redis3 │ 3.5.2.3 │ Jan 1, 2022 │ Python client for Redis key-value store │
│ 📂 redis │ 4.1.2 == │ Jan 27, 2022 │ Python client for Redis database and key-value store │
│ 📂 django-redis │ 5.2.0 │ Dec 22, 2021 │ Full featured redis cache backend for Django. │
│ 📂 redis-ipc │ 0.0.1 │ Jun 27, 2021 │ A minimal multi producer single consumer IPC using redis pub/sub │
│ 📂 bottle-redis │ 0.2.3 │ Jun 3, 2015 │ Redis integration for Bottle. │
│ 📂 rivescript-redis │ 0.1.0 │ Feb 21, 2017 │ Redis driver for RiveScript │
│ 📂 flypper-redis │ 0.1.2 │ Jan 23, 2022 │ Feature flags, with a GUI - Redis backend │
│ 📂 JCoder-redis │ 0.0.5 │ May 1, 2021 │ This Redis is a Python library based on redis. │
│ 📂 openid-redis │ 1.1 │ Mar 3, 2014 │ A Redis storage backend for the python-openid package │
│ 📂 serialized-redis │ 0.1.5 │ Oct 12, 2014 │ A solution to have lists and dictionaries serialized using redis-py. │
│ 📂 redis-trib │ 0.6.2 │ Nov 1, 2019 │ Redis Cluster tools in Python │
│ 📂 redis_proxy │ 0.0.2 │ Sep 11, 2013 │ a redis proxy that will seperate read and write │
│ 📂 redis-index │ 0.1.11 │ Nov 8, 2019 │ Inverted Index using efficient Redis set │
│ 📂 redis-tornado │ 0.2 │ Aug 28, 2012 │ Async redis client built on the Tornado IOLoop. │
│ 📂 sdh.redis │ 0.1.0 │ Oct 31, 2020 │ Django redis wrapper │
│ 📂 redis-collections │ 0.11.0 │ Jan 19, 2022 │ Set of basic Python collections backed by Redis. │
│ 📂 restful-redis │ 0.0.2 │ Feb 24, 2018 │ Redis queues for synchronous server2server ops │
│ 📂 redis-persistence │ 0.0.4 │ Jan 5, 2021 │ A python module to make your Telegram bot persistent using Redis │
│ 📂 cp-redis │ 0.0.1 │ Jan 2, 2020 │ This is Carpool Project subpackage: cp cp-redis │
│ 📂 disposable-redis │ 0.2 │ Aug 4, 2015 │ UNKNOWN │
│ 📂 stati-redis │ 0.0.7 │ May 12, 2013 │ Python client with redis transport for GottWall statistics aggregator │
│ 📂 exec-redis │ 0.0.10 │ Dec 2, 2021 │ Redis handler. │
│ 📂 redis_triggers │ 0.1 │ Jul 30, 2016 │ Redis Key events that executes a function written by you such as on expiry │
│ 📂 namekox-redis │ 0.0.26 │ Apr 29, 2021 │ namekox redis │
│ 📂 Mask-Redis │ 1.0.0a1 │ Jun 29, 2021 │ Redis extension for Mask. │
│ 📂 redis-pal │ 0.1.4 │ Jun 15, 2021 │ Store things in Redis without worrying about types or anything, just do it! │
│ 📂 redis-schematics │ 0.3.1 │ Feb 14, 2020 │ Redis storage backend for schematics. │
│ 📂 celerybeat-redis │ 0.1.5 │ Apr 4, 2016 │ A Celery Beat Scheduler that uses Redis to store both schedule definitions and status information │
│ 📂 redis-funnel │ 0.0.1 │ Mar 26, 2019 │ A distributed funnel system based on redis, management system included. │
│ 📂 redis-cirrus │ 2.10.5 │ Apr 20, 2016 │ Python client for Redis key-value store │
│ 📂 redis-sentinel │ 1.0.1 │ Sep 11, 2020 │ Redis connection fully managed by sentinel │
│ 📂 redis-completion │ 0.5.0 │ Apr 20, 2013 │ autocomplete with redis │
│ 📂 redis_drs │ 0.0.3 │ Mar 4, 2015 │ A Distributed Resource Scheduling system that uses Redis. │
│ 📂 kinto-redis │ 2.1.0 │ Nov 16, 2021 │ Kinto Redis │
│ 📂 redis-memslider │ 0.1.2 │ Feb 29, 2016 │ Gradually reduce redis maxmemory.REDIS (redis.io) will block while ensuring maxmemory is honored, so when reducing it │
│ │ │ │ significantlyit is helpful to do so over a period of time in smaller steps if necessary. For example an AWS EC2m2.2xlarge instance │
│ │ │ │ takes in the vicinity of 1-5 seconds to evict 256MB of keys. │
│ 📂 redis-relay │ 0.0.1 │ Jul 25, 2018 │ redis relay for interprocess communication │
│ 📂 py-redis │ 1.1.1 │ Dec 13, 2021 │ A convenience wrapper for the official Python redis package │
│ 📂 joker-redis │ 0.0.3 │ Jan 21, 2022 │ redis based utilities │
│ 📂 redis_tryton │ 0.4 │ Mar 5, 2018 │ Redis Cache for the Tryton Framework │
└──────────────────────┴──────────┴──────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
第三方库:
redis-py-cluster: 最近还在维护
rediscluster: 似乎很久没有更新了
pip install redis-py-cluster==2.1.3
or
pip install rediscluster
代码
from rediscluster import RedisCluster
# redis cluster 集群最少三主三从
startup_nodes = [
{"host":"192.168.3.25", "port":6379}, # 主
{"host":"192.168.3.25", "port":7001}, # 6379的从数据库
{"host":"192.168.3.25", "port":6380}, # 主
{"host":"192.168.3.25", "port":7002}, # 6380的从数据库
{"host":"192.168.3.25", "port":6381}, # 主
{"host":"192.168.3.25", "port":7003} # 6381的从数据库
]
# 连接集群
redis_server = RedisCluster(startup_nodes=startup_nodes, decode_responses=True,password='aaa')
redis_server.set('name', 'lowman')
redis_server.get('name')
参考:http://t.zoukankan.com/lowmanisbusy-p-10991605.html
https://blog.csdn.net/qq_42048263/article/details/122731953
http://www.manongjc.com/detail/15-xysgvqkubrgzlbw.html