Sign inSign up

datacore/redis

By datacore

Updated almost 6 years ago

Dockerized Redis + Sentinel

Image
0

10K+

datacore/redis repository overview

build status

Docker image for redis server with optional sentinel.

Introduction

Docker image for running Redis, image is based upon Alpine Linux.

Redis is an open source, BSD licensed, advanced key-value cache and store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, sorted sets, bitmaps and hyperloglogs.

Docker Registries

  • datacore/redis:latest
  • registry.timmertech.nl/docker/redis:latest

Source Repositories

Installation

Install from DockerHub

Download:

docker pull datacore/redis:latest

Build:

docker build -t datacore/redis https://github.com/gjrtimmer/docker-redis


Install from TimmerTech

Download:

docker pull registry.timmertech.nl/docker/redis:latest

Build:

docker build -t datacore/redis https://gitlab.timmertech.nl/docker/redis

Examples

Locations

Default(s):

TypeDefault
Redis Port6379
Sentinel Port26379
Data/var/lib/redis
Log(s)/var/log/redis
Unix Socket/var/run/redis/redis.sock

Configuration

General
General Configuration

OptionDefaultDescription
REDIS1 / trueActivate Redis Server
SENTINEL0 / falseActivate Redis Sentinel
USERMAP_UIDredisMap ownership to UID
USERMAP_GIDredisMap ownership to GID


Redis
Redis Configuration

OptionDefaultDescription
REDIS1 / trueActivate Redis Server
REDIS_TIMEOUT0Close the connection after a client is idle for N seconds (0 to disable)
REDIS_KEEPALIVE300TCP keepalive.

If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
of communication. This is useful for two reasons:

1) Detect dead peers.
2) Take the connection alive from the point of view of network
equipment in the middle.

On Linux, the specified value (in seconds) is the period used to send ACKs.
Note that to close the connection the double of the time is needed.
On other kernels the period depends on the kernel configuration.

A reasonable value for this option is 300 seconds, which is the new
Redis default starting with Redis 3.2.1.
REDIS_DATABASES16Number of redis databases
REDIS_DATA/var/lib/redisData directory of redis
REDIS_PASSWORD-Redis password
REDIS_MAXCLIENTS10000Max connected clients
REDIS_MIN_SLAVES_TO_WRITE1It is possible for a master to stop accepting writes if there are less than
N slaves connected, having a lag less or equal than M seconds.
REDIS_MIN_SLAVES_MAX_LAG10It is possible for a master to stop accepting writes if there are less than
N slaves connected, having a lag less or equal than M seconds.


Slave
Slave Configuration

OptionDefaultRequiredDescription
SLAVE0-Mark redis server as slave
SLAVE_MHOST-YesIP of master server
SLAVE_MPORT6379NoPort of the master redis server
SLAVE_MPASS-NoPassword of the master redis server
SLAVE_IP-NoPublish IP of slave, used for docker NAT, IP is the docker host IP to reach container, uses redis slave-announce-ip
SLAVE_PORT-NoPublish port of slave, used for docker, PORT is the docker host port to reach container, uses redis slave-announce-port


Sentinel
Sentinel Configuration

OptionDefaultRequiredDescription
SENTINEL0-Activate redis-server sentinel
SENTINEL_IP-NoPublish IP of sentinel, used for docker NAT, IP is the docker host IP to reach container, uses sentinel announce-ip
SENTINEL_PORT-NoPublish IP of sentinel, used for docker NAT, PORT is the docker host PORT to reach container, uses sentinel announce-ip
SENTINEL_MSET-YesName of master set
SENTINEL_MHOST-YesIP of master redis
SENTINEL_MPORT6379NoPort of master redis server
SENTINEL_MPASS-NoPassword of master redis server
SENTINEL_QUORUM-YesQuorum voting value
SENTINEL_DOWN_AFTER_MS30000NoNumber of milliseconds the master (or any attached slave or sentinel) should
be unreachable (as in, not acceptable reply to PING, continuously, for the
specified period) in order to consider it in S_DOWN state (Subjectively
Down).

Default is 30 seconds.
SENTINEL_PARALLEL_SYNCS1NoHow many slaves we can reconfigure to point to the new slave simultaneously
during the failover. Use a low number if you use the slaves to serve query
to avoid that all the slaves will be unreachable at about the same
time while performing the synchronization with the master.

Tag summary

Content type

Image

Digest

Size

15.6 MB

Last updated

almost 6 years ago

docker pull datacore/redis