本文主要是介绍【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:6379docker 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
顺利运行
这篇关于【Redis】arm64架构,docker的Redis出现Failed to test the kernel for a bug that could lead to data corruption的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!