Перейти к содержанию

Ошибка базы Redis

Текст самой ошибки

┌─( [email protected] ) - ( 29 files,  ) - ( ~ )
└─> docker logs -f $(docker ps -f name=redis -q | head -n 1)
1:C 09 Sep 2023 12:38:27.218 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 09 Sep 2023 12:38:27.218 # Redis version=7.0.13, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 09 Sep 2023 12:38:27.218 # Configuration loaded
1:M 09 Sep 2023 12:38:27.220 # Server initialized
1:M 09 Sep 2023 12:38:27.220 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 09 Sep 2023 12:38:27.633 # Bad file format reading the append only file appendonly.aof.15.incr.aof: make a backup of your AOF file, then use ./redis-check-aof --fix <filename.manifest>

Решение

┌─( [email protected] ) - ( 29 files,  ) - ( ~ )
└─> docker run --entrypoint "" --rm -it -v database_nfs_redis:/data redis:7.0-alpine redis-check-aof --fix /data/appendonlydir/appendonly.aof.manifest 
Start checking Multi Part AOF
Start to check BASE AOF (RDB format).
[offset 0] Checking RDB file appendonly.aof.15.base.rdb
[offset 27] AUX FIELD redis-ver = '7.0.12'
[offset 41] AUX FIELD redis-bits = '64'
[offset 53] AUX FIELD ctime = '1694198625'
[offset 68] AUX FIELD used-mem = '1797496'
[offset 80] AUX FIELD aof-base = '1'
[offset 82] Selecting DB ID 0
[offset 267519] Checksum OK
[offset 267519] \o/ RDB looks OK! \o/
[info] 1753 keys read
[info] 38 expires
[info] 38 already expired
RDB preamble is OK, proceeding with AOF tail...
AOF analyzed: filename=appendonly.aof.15.base.rdb, size=267519, ok_up_to=267519, ok_up_to_line=1, diff=0
BASE AOF appendonly.aof.15.base.rdb is valid
Start to check INCR files.
AOF appendonly.aof.15.incr.aof format error
AOF analyzed: filename=appendonly.aof.15.incr.aof, size=11348289, ok_up_to=10425379, ok_up_to_line=363568, diff=922910
This will shrink the AOF appendonly.aof.15.incr.aof from 11348289 bytes, with 922910 bytes, to 10425379 bytes
y
Continue? [y/N]: Successfully truncated AOF appendonly.aof.15.incr.aof
All AOF files and manifest are valid
К началу