• 【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 | Redis
    Overview of redis.conf, the Redis configuration file
    https://redis.io/docs/manual/config/

    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
    x
  • 相关阅读:
    Ubuntu安装软件问题的解决
    寻找两个字符串中最长的公共部分字符串
    CentOS
    vim自定义配置
    git创建远程仓库以及在本地提交到远程仓库的方法
    黑金开发板在NiosII环境下烧写image到flash失败的解决办法
    f.lux 一款免费的护眼开源软件
    python 制作自动化脚本
    修改python 默认的存储路径
    第一篇博客
  • 原文地址:https://www.cnblogs.com/hongmaju/p/16716387.html
Copyright © 2020-2023  润新知