GitXplorerGitXplorer
s

redis-sentinel-example

public
1 stars
1 forks
0 issues

Commits

List of commits on branch master.
Verified
341ecf742d73d517005d874bdd0e195213d3013a

Merge pull request #2 from s3rvac/dependabot/pip/test-client/redis-4.5.4

ss3rvac committed 2 years ago
Verified
78faf804e637d30f5a870263e4697a6e07ef0e15

Bump redis from 4.5.3 to 4.5.4 in /test-client

ddependabot[bot] committed 2 years ago
Verified
30117112c479f05aedf553b460f5d4be9543347e

Merge pull request #1 from s3rvac/dependabot/pip/test-client/redis-4.5.3

ss3rvac committed 2 years ago
Verified
dd4111fa4c751e9b51ee2893953ba8a7b1f56f46

Bump redis from 3.4.1 to 4.5.3 in /test-client

ddependabot[bot] committed 2 years ago
Verified
ec8df5c7238674b831093a55da1b8bf1f313277a

Remove unused import from test-client.py.

ss3rvac committed 5 years ago
Verified
8b6231f5d3609acc5d00a46834d3f510737b3cc4

Improve a comment in bootstrap.sh.

ss3rvac committed 5 years ago

README

The README file for this repository.

A sample configuration of redis-sentinel on three nodes

An example of a redis-sentinel configuration on three nodes, including a testing Python client.

For educational and experimental use only.

Here is the architecture:

       +----+
       | M1 |
       | S1 |
       +----+
          |
+----+    |    +----+
| R2 |----+----| R3 |
| S2 |         | S3 |
+----+         +----+

R denotes a redis-server instance, S denotes redis-sentinel instance, and M is the master.

Configuration files are in the configs directory.

Requirements

Tested on Linux.

Installation

To create all the three boxes, run

vagrant up

Use

To SSH into the boxes, execute

vagrant ssh redis1
vagrant ssh redis2
vagrant ssh redis3

Then, run sudo -Hs to get root access. To see how failover works, you can stop redis-server by running

systemctl stop redis-server

To stop redis-sentinel, run

systemctl stop redis-sentinel

You can tail -f logs in /var/log/redis to see what is happening.

Python client

In test-client, there is a simple Python script that you can use for your experiments. It is based on redis-py.

License

Copyright (c) 2020 Petr Zemek (s3rvac@gmail.com)

Distributed under the MIT license. See the LICENSE file for more details.