Issue
Background
Yesterday our machine crashed unexpectedly and our AOF file for Redis got corrupted.
Upon trying to start the service with sudo systemctl start redis-server
we are greeted with the following logs:
Bad file format reading the append only file: make a backup of your AOF file, then use ./redis-check-aof --fix
Research
Aparently this looks like a simple error to fix, just execute ./redis-check-aof --fix <filename>
.
Except I don't have the smallest idea of where that file is.
I have searched the Github discussions for this issue, but unfortunately none provides me with the location for the file:
The persistence documentation also doesn't make a mention of the location for this file:
Specs
These are the specs of the system where I am running Redis:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
Question
Where is located this file?
Solution
You have two choices:
- Find the configure file for Redis, normally, it's named
redis.conf
. Thedir
andappendfilename
configuration specify the directory and file name of theAOF
file. - Connect to Redis with
redis-cli
, and use theCONFIG GET
command to get thedir
configuration, i.e.CONFIG GET dir
. TheAOF
file should located under this directory.
Answered By - for_stack Answer Checked By - Willingham (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.