Redis-Sentinel-Url is a Python library that provides a parser and connection factory for Redis connections, specifically supporting both standard `redis://` and the custom `redis+sentinel://` URL schemes. It allows applications to connect to Redis instances via Sentinel for high availability. The library is currently at version 1.0.1, with its last major update addressing password handling, and it appears to be in maintenance mode, offering stable functionality rather than active feature development.
pip install Redis-Sentinel-UrlVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `redis_sentinel_url.connect()` to establish connections. It attempts to connect using a `redis+sentinel://` URL, retrieving both the Sentinel client and a `StrictRedis` client for the master. It also illustrates setting and getting a key to confirm functionality. Ensure your `REDIS_SENTINEL_URL` environment variable is correctly configured with your Redis Sentinel setup.
Upgrade to version 1.0.1 or higher: `pip install --upgrade Redis-Sentinel-Url`. Ensure your URL includes passwords for both the Redis master (as `password=`) and Sentinel instances (as `sentinel_password=`) if applicable.
Ensure `redis-py` is installed and is version 2.9.0 or higher. You can check with `pip show redis` and upgrade with `pip install --upgrade redis`.
Double-check your `redis+sentinel://` URL for typos. Verify that the `service_name` matches your Redis Sentinel configuration exactly and that all listed sentinel `host:port` pairs are correct and accessible from the application. Consult your Redis Sentinel configuration (`sentinel.conf`) for details.
Verify that your Sentinel instances are running and healthy on the specified `host:port`. Check the `service_name` in your connection URL against your `sentinel.conf` configuration. Ensure network connectivity and correct firewall rules to the Sentinel ports (default 26379).
Check if the Sentinel process is running on `localhost:26379`. Verify network connectivity between your application and the Sentinel server. Ensure no firewall rules are blocking the connection on port 26379.
Include the correct password(s) in your `redis+sentinel://` URL. For the Redis master, use `?password=your_redis_master_password`. For Sentinel authentication (Redis 6.2+), use `?sentinel_password=your_sentinel_password`.