• Stars
    star
    108
  • Rank 319,620 (Top 7 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Redis cluster cache configuration for docker swarm

Redis Cluster Cache for Docker Swarm

CircleCI

Quick and dirty Redis cluster taking advantage of Redis Sentinel for automatic failover. Persistence is turned off by default.

Usage

  1. Setup docker swarm
  2. Create a overlay network:
docker network create --attachable --driver overlay redis
  1. Modify scripts/docker-compose.yml to how you want to deploy the stack.
  2. Run scripts/bootstrap.sh.
bash scripts/bootstrap.sh latest
  1. Connect to with redis-cli
docker run --rm --network redis -ti redis:4.0.11-alpine redis-cli -h redis

To access the redis cluster outside of docker, port 6379 needs to be expose. This can be done by adding ports to the docker-compose file:

...
  redis:
    image: thomasjpfan/redis-look
    ports:
      - "6379:6379"
...

Details

A docker service called redis-zero is created to serve as the initial master for the redis sentinels to setup. The redis-look instances watches the redis sentinels for a master, and connects to redis-zero once a master has been decided. Once the dust has settled, remove the redis-zero instance and wait for failover to take over so a new redis-master will take over. Use redis-utils to reset sentinels so that its metadata is accurate with the correct state.

The use of redis-zero as a bootstrapping step allows for the docker-compose.yml to provide only the long running services:

version: '3.1'

services:

  redis-sentinel:
    image: thomasjpfan/redis-sentinel
    environment:
      - REDIS_IP=redis-zero
      - REDIS_MASTER_NAME=redismaster
    deploy:
      replicas: 3
    networks:
      - redis

  redis:
    image: thomasjpfan/redis-look
    environment:
      - REDIS_SENTINEL_IP=redis-sentinel
      - REDIS_MASTER_NAME=redismaster
      - REDIS_SENTINEL_PORT=26379
    deploy:
      replicas: 3
    networks:
      - redis

networks:
  redis:
    external: true

Scaling

From now on just scale redis to expand the number of slaves or scale redis-sentinel to increase the number of sentinels.

More Repositories

1

pytorch_refinenet

Pytorch Implementation of Refinenet
Python
160
star
2

awesome-python-data-science

A curated list of Python libraries used for data science.
65
star
3

ml-workshop-intro

Introduction to scikit-learn: Machine Learning in Python
Jupyter Notebook
20
star
4

ml-workshop-intermediate-2-of-2

Jupyter Notebook
17
star
5

docker-scaler

Microservice providing a REST API that scales services in Docker Swarm.
Go
17
star
6

slides-template-hugo

JavaScript
15
star
7

ml-workshop-intermediate-1-of-2

Jupyter Notebook
15
star
8

ml-workshop-advanced

Jupyter Notebook
15
star
9

ansible-docker-swarm-role

Configures a Docker Swarm cluster.
Python
15
star
10

data-umbrella-2020-streamlit-ml

Jupyter Notebook
13
star
11

rustimport_jupyter

Jupyter and iPython magic for compiling Python extensions written in Rust
Jupyter Notebook
12
star
12

pydata-2019-histgradientboosting

Jupyter Notebook
10
star
13

skconfig

Experimental library for sampling and validating scikit-learn parameters
Python
10
star
14

pydata2018_dc_skorch

Pydata DC 2018 (Skorch - A Union of Scikit-learn and PyTorch)
Jupyter Notebook
6
star
15

sklearn-repo-status

Python
5
star
16

ml-workshop-intermediate-v2

Jupyter Notebook
5
star
17

scipy-2022-poisson

Jupyter Notebook
4
star
18

scipy-2021-streamlit-demo

Jupyter Notebook
4
star
19

pytorch_unet

Hassle Free UNet Implementation
Python
4
star
20

scipy-2021-streamlit

CSS
3
star
21

skorch_talk

Talk covering the features of skorch
Jupyter Notebook
3
star
22

slides-template-quarto

SCSS
3
star
23

scipy-2023-too-parallel

HTML
3
star
24

parallelism-python-libraries-design

CSS
3
star
25

ml-workshop-intro-v2

Jupyter Notebook
2
star
26

nyc-python-2020-lightning-how-calibrated-are-you

Jupyter Notebook
2
star
27

skvalid

Lightweight scikit-learn validation framework
Python
2
star
28

pydata-nyc-2022-parallelism

HTML
2
star
29

sklearn-set_output-material

CSS
2
star
30

ansible-setup-user-role

Setups User and SSH keys
Makefile
2
star
31

ansible-docker-role

Installs Docker-CE on an Ubuntu 16.04
Python
2
star
32

ansible-ufw-cluster-role

Configures UFW to allow port access between a cluster of hosts.
Makefile
2
star
33

ml-workshop-intro-v3

Jupyter Notebook
2
star
34

pydata-nyc-meetup-2024-stumpy

Time Series EDA with STUMPY
SCSS
2
star
35

cookiecutter-data-science

Flexiable data science template with a somewhat logical model experimental support.
Python
2
star
36

odsc_nyc_2019_06_29

1
star
37

data-umbrella-2020-streamlit-slides

Data Umbrella 2020 streamlit slides
CSS
1
star
38

libomp-osx-vendor

1
star
39

sk-typing

Python
1
star
40

2020-czi-scikit-learn

JavaScript
1
star
41

ansible-ubuntu-local-runner

Docker image used to test Ansible Roles that needs systemd.
Shell
1
star
42

sklearn_experimental_talk

1
star
43

etcd-snapper-b2

Go
1
star
44

ml-journal

Code and notebooks used to produce the analysis done on my blog.
Jupyter Notebook
1
star
45

ames_housing_hiplot

Jupyter Notebook
1
star
46

azure_pipeline_artifacts

Testing azure pipeline artifacts
1
star
47

2020-richmond-ds-meetup-gradient-boosting

JavaScript
1
star
48

ansible-docker-runner

Ansible runner for testing playbooks with docker connection
Shell
1
star
49

bench-slep014

Jupyter Notebook
1
star
50

ansible-rexray-s3fs-role

Ansible role for install Docker 1.13+ style rexray plugin
1
star
51

seaborn-docset

Dash docset for seaborn
Python
1
star
52

sksearchspace

Defines search spaces for scikit-lean estimators
Python
1
star
53

pydata-nyc-meetup-2023-contributing-open-source

SCSS
1
star
54

blog-scikit-learn

Hosting the scikit-learn blog.
SCSS
1
star
55

array-api-compat

Compatibility layer for NumPy to support the Array API
Python
1
star
56

arviz

Exploratory analysis of Bayesian models with Python
Python
1
star
57

cython_memoryview_abi3

Python
1
star
58

odsc-2024-east-flyte

HTML
1
star
59

imagespec-fast-builder

Python
1
star