openimsdk / openim-docker

openim-docker configuration for deploying OpenIM. Provides a build solution for a stable distribution, as well as a docker compose deployment strategy
https://openim.io
Apache License 2.0
31 stars 39 forks source link

Bug: redis and other components can't start #104

Closed PaoPaoYo closed 4 months ago

PaoPaoYo commented 6 months ago

What happened?

redis and other components can't start

What did you expect to happen?

start openim successfully

How can we reproduce it (as minimally and precisely as possible)?

  1. clone git
  2. set OPENIM_IP
  3. docker compose up -d

Anything else we need to know?

docker ps image

redis log image

version

```console $ {name} version # paste output here ```

Cloud provider

OS version

```console # On Linux: $ cat /etc/os-release NAME="CentOS Linux" VERSION="8" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="8" PLATFORM_ID="platform:el8" PRETTY_NAME="CentOS Linux 8" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:8" HOME_URL="https://centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-8" CENTOS_MANTISBT_PROJECT_VERSION="8" $ uname -a Linux ecs-69da-0001 4.18.0-147.5.1.el8_1.aarch64 #1 SMP Tue Feb 4 23:44:08 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux ```

Install tools

cubxxw commented 6 months ago

The error message "WARNING Your kernel has a bug that could lead to data corruption during background save" indicates that the operating system kernel has a known defect that could potentially corrupt data during Redis's background save operation (which writes data from memory to disk for persistence). This warning specifically mentions the ARM64 architecture kernel and tags the error with the code ARM64-COW-BUG.

COW stands for "Copy-On-Write," a strategy that allows resources such as files or memory pages to be shared between multiple tasks until one of the tasks attempts to modify these resources. At that point, the system makes a copy of the resource for that task. In the affected kernel versions, this COW mechanism might not work correctly, potentially leading to data corruption during the save process in Redis.

Here are the methods to resolve this issue:

  1. Upgrade the Kernel: The most straightforward resolution is to upgrade to the latest stable version of the kernel. This typically involves downloading and installing the update from your Linux distribution's official software repository, which can usually be done through your package manager. After upgrading, you will need to restart the system to use the new kernel.

  2. Ignore the Warning: If it's not possible to upgrade the kernel immediately, Redis offers a way to suppress this warning by setting the configuration option ignore-warnings ARM64-COW-BUG. This can be set in the Redis configuration file or passed as a command-line argument when starting Redis. However, this merely hides the warning and does not address the potential for data corruption, so it's not a long-term solution.

  3. Backup Data: Concurrently with addressing the kernel issue, regularly backing up your Redis data is a good practice to prevent data loss. In the event of data corruption, you would be able to restore from a recent backup.

  4. Monitor the System and Redis: After upgrading the kernel and suppressing warnings, continue to monitor the system behavior and Redis logs to ensure no further issues occur. If related errors or warnings persist after an upgrade, further technical support might be needed.

Remember, before making any system-level changes, especially kernel upgrades, ensure that you have a complete system backup and understand how to revert changes if necessary. If you are not familiar with these processes, professional technical support may be required.