Docker failed to run redis image: crash

Pull the latest redis image from the docker image warehouse. After running the image, it is found that the service exits within seconds. Check the running log and get the error: Fatal:can not initialize background jobs:

After checking various information, I realized that my Linux environment and docker environment may not support the latest version of redis, because the redis version I pulled is 7.0+, so I plan to pull the redis:5.0 version image to try. Later I found that the 5.0 version of the image can run normally.

Solution: Change to a redis image version that matches the environment.

After using the correct redis version, shut down the virtual machine (stop the redis container before shutting down). After restarting the virtual machine, I found that the redis container was restarted, and it crashed just after restarting. Later I found out that selinux was not closed before starting the redis container. ,

Check selinux status: ("Enforcing" is on, "Permissive" is off)

# getenforce ## View status
# setenforce 0 ## Temporarily closed

Permanently closed:

Modify the configuration file /etc/selinux/config

Change the SELINUX=XX line in the file to SELINUX=disabled or SELINUX=permissive, then save and exit, and restart to take effect.

Guess you like

Origin blog.csdn.net/hanjiangxue0912/article/details/131549031