【Redis】arm64架构,docker的Redis出现Failed to test the kernel for a bug that could lead to data corruption

一、问题说明

在运行docker的redis镜像,log打印

# Failed to test the kernel for a bug that could lead to data corruption during background save. Your system could be affected, please report this error.
# Redis will now exit to prevent data corruption. Note that it is possible to suppress this warning by setting the following config: ignore-warnings ARM64-COW-BUG

翻译:

#无法测试内核是否存在可能导致后台保存期间数据损坏的错误。您的系统可能受到影响,请报告此错误。

#Redis现在将退出以防止数据损坏。请注意,可以通过设置以下配置来抑制此警告:忽略警告ARM64-COW-BUG

二、解决方法

解决方式很简单,日志已经提醒需要在redis.config中添加配置 

 ignore-warnings ARM64-COW-BUG

但是,容器都没启动成功,根本没法获取容器中的redis.conf文件。

因此,需要先在宿主机上配置好redis.conf,再映射进容器中

我们需要在redis官网找到对应redis版本的配置文件,版本可以在dockerHub上查

Redis configuration | RedisOverview of redis.conf, the Redis configuration filehttps://redis.io/docs/manual/config/

1、查找redis镜像使用的版本

2、在官网找到对应版本,复制进创建的redis.conf 

 3、然后将配置文件最后一行#ignore-warnings ARM64-COW-BUG的注释#去掉, 保存即可

4、然后重新运行redis容器

# 映射配置文件所在地址:  -v /docker_home/redis_home/conf:/usr/local/etc/redis
# 映射redis数据保存地址: -v/docker_home/redis_home/data:/data
# 使用配置文件:redis-server /usr/local/etc/redis/redis.conf
# 设置默认将数据保存到磁盘时间60秒:--save 60 1
# 映射6379端口:-p 6379:6379

docker run -v /docker_home/redis_home/conf:/usr/local/etc/redis -v/docker_home/redis_home/data:/data -p 6379:6379 -d --name redis redis redis-server /usr/local/etc/redis/redis.conf --save 60 1

 顺利运行

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值