Redis server refused to connect while using docker image

Viewed 1378

i am using docker to start using postgres, kibana, elasticsearch and redis.(using docker-compose up command). However redis failed to start giving this error.

You can see read the last error line in the screenshot(showing bad file format). How can i resolve this? Also i dont know how to run redis commands in terminal using docker such as ./redis-check-aof --fix as given in screenshot?

2 Answers

Like Uku mentions, the AOF file has become corrupted and you should run a command to fix it. The correct command for the official Redis redis:4.0.11-alpine image is:

docker-compose run redis redis-check-aof --fix appendonly.aof

This assumes the name of your redis container is "redis". Hit "y" to confirm (it's not phrased like a question but it needs that input.

EDIT: Your redis AOF file has become corrupted. Two options:

1) if you don't care about the data, you could just delete the volume and recreate it

2) if you do care about the data, temporarily add the entrypoint definition for redis service:

entrypoint:
 - redis-check-aof
 - --fix
 - /data/appendonly.aof

docker-compose up once, and then remove it, this should hopefully fix it

Related