PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, September 5, 2022

[FIXED] What is the default location for Redis AOF file for Ubuntu?

 September 05, 2022     redis, ubuntu-16.04     No comments   

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:

  • https://github.com/antirez/redis/issues/4931

The persistence documentation also doesn't make a mention of the location for this file:

  • https://redis.io/topics/persistence

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:

  1. Find the configure file for Redis, normally, it's named redis.conf. The dir and appendfilename configuration specify the directory and file name of the AOF file.
  2. Connect to Redis with redis-cli, and use the CONFIG GET command to get the dir configuration, i.e. CONFIG GET dir. The AOF file should located under this directory.


Answered By - for_stack
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,207,428

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing