summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorTerence Honles <terence@honles.com>2021-11-08 16:54:24 +0100
committerGitHub <noreply@github.com>2021-11-08 17:54:24 +0200
commitfea7b85dde375a228f485d27737de66592b28848 (patch)
tree9faee58304479a7c66ce0755c838b07f402a03ae /README.md
parent325fcd9e15bf0125f9a60012d7eb7824e7b4ab33 (diff)
downloadredis-py-fea7b85dde375a228f485d27737de66592b28848.tar.gz
Export Sentinel, and SSL like other classes (#1671)
Diffstat (limited to 'README.md')
-rw-r--r--README.md14
1 files changed, 13 insertions, 1 deletions
diff --git a/README.md b/README.md
index a01f820..f03053e 100644
--- a/README.md
+++ b/README.md
@@ -365,7 +365,7 @@ Connecting redis-py to the Sentinel instance(s) is easy. You can use a
Sentinel connection to discover the master and slaves network addresses:
``` pycon
->>> from redis.sentinel import Sentinel
+>>> from redis import Sentinel
>>> sentinel = Sentinel([('localhost', 26379)], socket_timeout=0.1)
>>> sentinel.discover_master('mymaster')
('127.0.0.1', 6379)
@@ -373,6 +373,18 @@ Sentinel connection to discover the master and slaves network addresses:
[('127.0.0.1', 6380)]
```
+To connect to a sentinel which uses SSL ([see SSL
+connections](#ssl-connections) for more examples of SSL configurations):
+
+``` pycon
+>>> from redis import Sentinel
+>>> sentinel = Sentinel([('localhost', 26379)],
+ ssl=True,
+ ssl_ca_certs='/etc/ssl/certs/ca-certificates.crt')
+>>> sentinel.discover_master('mymaster')
+('127.0.0.1', 6379)
+```
+
You can also create Redis client connections from a Sentinel instance.
You can connect to either the master (for write operations) or a slave
(for read-only operations).