Git Product home page Git Product logo

redis-sentinel-cluster's Introduction

Configuración

Debemos editar el archivo .env y ajustar los valores a nuestro escenario.

La mayoría de los valores pueden quedar como están, pero debemos asegurarnos que el valor para HOST_IP refleje la dirección ip que pensamos exponer a los clientes.

Agregar un esclavo

Agremos una linea en .env para definir el puerto en el que escuchará ese nodo

SLAVEx_PORT=6385

Editamos docker-compose.yml y agregamos una sección similar a la siguiente

redis-slave-x:
  image: vision/redis
  container_name: redis-slave-x
  restart: on-failure:5
  ports:
    - "${SLAVEx_PORT}:6379"
  environment:
    - SLAVE=true
    - HOST_IP=${HOST_IP}
    - PORT=${SLAVEx_PORT}
    - MASTER_PORT=${MASTER_PORT}
  secrets:
    - redis-auth
  links:
    - redis-master

Nos aseguramos de especificar la variable con el valor del puerto que acabamos de crear en ports y en la variable de entorno PORT en la sección environment

Agregar un sentinela

Agremos una linea en .env para definir el puerto en el que escuchará el sentinela.

SENTINELx_PORT=26385

Editamos docker-compose.yml y agregamos una sección similar a la siguiente

redis-sentinel-x:
  image: vision/redis
  container_name: redis-sentinel-x
  restart: on-failure:5
  ports:
    - "${SENTINELx_PORT}:26379"
  environment:
    - SENTINEL=true
    - HOST_IP=${HOST_IP}
    - PORT=${SENTINELx_PORT}
    - MASTER_PORT=${MASTER_PORT}
    - SENTINEL_QUORUM=2
    - SENTINEL_DOWN_AFTER=1000
    - SENTINEL_FAILOVER=1000
    secrets:
      - redis-auth
  links:
    - redis-master

Nos aseguramos de especificar la variable con el valor del puerto que acabamos de crear en ports y en la variable de entorno PORT en la sección environment

Inspiración:

An example setup for using Redis Sentinel with Docker Compose.
See my blog post for more information and an explanation: https://blog.alexseifert.com/2016/11/14/using-redis-sentinel-with-docker-compose/

redis-sentinel-cluster's People

Contributors

padiazg avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.