0
点赞
收藏
分享

微信扫一扫

Redis 启动失败:原因appendonly.aof 损坏

googlefrank 2023-03-08 阅读 93

Redis 由于机器重启导致启动出现该错误:

Bad file format reading the append only file: make a backup of your AOF file, then use ./redis-check-aof --fix <filename>

解决方法:

1、首先启动redis看redis的启动的状态

             /opt/redis/sbin/redis.service restart

             ps -ef | grep redis

            发现没有启动,然后看查redis的日志文件

2、找到Redis的log文件 /opt/redis/logs/redis.log

     发现报错:

Redis 启动失败:原因appendonly.aof 损坏_redis

3、去redis数据目录,将aof文件备份,用redis-check-aof工具修复

     即执行命令: 

/opt/redis/bin/redis-check-aof -- fix /mnt/data/redis/data/appendonly.aof

     不知道redis-check-aof 和备份文件appendonly.aof 存放路径的可以通过命令查找:

     find / -name redis-check-aof

     find / -name appendonly.aof

Redis 启动失败:原因appendonly.aof 损坏_重启_02

4、重启redis服务:/opt/redis/sbin/redis.service restart

举报

相关推荐

0 条评论