Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s3rvac/redis-sentinel-example
A sample configuration of redis-sentinel on three nodes.
https://github.com/s3rvac/redis-sentinel-example
configuration example redis redis-sentinel
Last synced: about 1 month ago
JSON representation
A sample configuration of redis-sentinel on three nodes.
- Host: GitHub
- URL: https://github.com/s3rvac/redis-sentinel-example
- Owner: s3rvac
- License: mit
- Created: 2020-02-18T18:11:51.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-01T07:19:53.000Z (almost 2 years ago)
- Last Synced: 2024-11-13T03:35:46.016Z (3 months ago)
- Topics: configuration, example, redis, redis-sentinel
- Language: Shell
- Size: 9.77 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A sample configuration of redis-sentinel on three nodes
An example of a [redis-sentinel](https://redis.io/topics/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](configs) directory.
## Requirements
* [Virtualbox](https://www.virtualbox.org/) for running virtual machines
* [Vagrant](https://www.vagrantup.com/) for setting up virtual machinesTested 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](test-client), there is a simple Python script that you can use
for your experiments. It is based on
[redis-py](https://redis-py.readthedocs.io/en/latest/).## License
Copyright (c) 2020 Petr Zemek ()
Distributed under the MIT license. See the `LICENSE` file for more details.