Deployed stack consists of three Redis instances, two Redis Sentinels, three Redis exporters, Prometheus, Grafana and Java Redis client.
Java client communicates with Redis Sentinels to get the location of Redis Master instance. In case Redis Master goes down failover will happen and one of the other two instances will become the new master.
To monitor the stack we use Prometheus server that scrapes metrics from Redis exporters. Visualization of the metrics is done using Grafana. Grafana instance comes with preconfigured datasource and Redis Dashboard.
Component | Image | Instances |
---|---|---|
Redis | redis:5.0 |
3 |
Redis Sentinel | redis:5.0 |
2 |
Redis exporter | oliver006/redis_exporter:v1.5.2-alpine |
3 |
Java Redis client | openjdk:8-slim |
1 |
Prometheus | prom/prometheus:v2.16.0 |
1 |
Grafana | grafana/grafana:6.7.0 |
1 |
Docker, Docker Compose, Java JDK 8 and Apache Maven are required to run this stack.
Use Maven to build Java Redis Client.
mvn -f .\docker\java\infobip-redis-service\pom.xml package
Build Docker images using docker-compose.
docker-compose -f .\docker\docker-compose.yml build
Pull all required images using docker-compose.
docker-compose -f .\docker\docker-compose.yml pull
To test Java Redis Client run integration tests using Maven.
mvn -f .\docker\java\infobip-redis-service\pom.xml test
Deploy stack using docker-compose.
docker-compose -f .\docker\docker-compose.yml up
To run docker containers in detached mode:
docker-compose -f .\docker\docker-compose.yml up -d
Check Grafana for Redis metrics using this link.
To access Grafana use username admin
and password secret
. Password can be configured in grafana service section in docker-compose.yml.
Redis dashboard can be found in General
folder.
For interaction with Redis Client go to this Swagger UI link.