URL Schemes¶
Redis.from_url() supports several URL schemes for different topologies.
Standalone¶
r = Redis.from_url("redis://localhost:6379/0")
r = Redis.from_url("redis://:password@host:6379/0")
r = Redis.from_url("redis://user:password@host:6379/0")
Format: redis://[user:password@]host[:port][/db]
Standalone with TLS¶
Warning
TLS is not yet implemented. Using rediss:// will raise an error.
Sentinel¶
v0.1.0 limitation
Sentinel URLs are parsed but routing is not yet implemented. The client connects to the first sentinel host as a standalone Redis server. Full sentinel master resolution and failover will be available in v0.2.
Format: redis+sentinel://[user:password@]master_name@host[:port][,host[:port]...][/db]
TLS variant: redis+sentinels://
Cluster¶
v0.1.0 limitation
Cluster URLs are parsed but routing is not yet implemented. The client connects to the first seed node as a standalone server. Full cluster slot mapping, MOVED/ASK handling, and replica reads will be available in v0.2.
Format: redis+cluster://[user:password@]host[:port][,host[:port]...][/db]
TLS variant: rediss+cluster://
Additional parameters¶
Override pool and timeout settings alongside the URL: