Docker启动Redis容器时报错WARNING: The TCP backlog setting of 511 cannot be enforced

这篇具有很好参考价值的文章主要介绍了Docker启动Redis容器时报错WARNING: The TCP backlog setting of 511 cannot be enforced。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

正常使用命令

docker pull redis

之后启动        

docker run --name m-redis -p 8379:6379 -v /data/redis/redis.conf:/usr/local/etc/redis/redis.conf -d redis

发现容器并没有启动,于是查看了一下logs 

[root@localhost redis]# docker logs m-redis
1:C 25 Sep 2023 04:03:47.852 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:C 25 Sep 2023 04:03:47.852 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 25 Sep 2023 04:03:47.852 * Redis version=7.2.1, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 25 Sep 2023 04:03:47.852 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 25 Sep 2023 04:03:47.852 * monotonic clock: POSIX clock_gettime
1:M 25 Sep 2023 04:03:47.852 * Running mode=standalone, port=6379.
1:M 25 Sep 2023 04:03:47.852 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 25 Sep 2023 04:03:47.853 # Fatal: Can't initialize Background Jobs. Error message: Operation not permitted

下意识得修改了宿主机的 /proc/sys/net/core/somaxconn 文件

echo 511 > /proc/sys/net/core/somaxconn

发现并没有什么卵用。考虑是镜像内的文件, 于是修改创建容器命令为

docker run -p 8379:6379 --name m-redis \
--sysctl net.core.somaxconn=1024 \
-v /data/docker/m-redis/data:/data \
-v /data/docker/m-redis/conf/redis.conf:/usr/local/etc/redis/redis.conf \
-e TIME_ZONE="Asia/Shanghai" \
-e TZ="Asia/Shanghai" \
-d --restart=always \
--privileged=true \
redis

docker ps 查看解决问题了文章来源地址https://www.toymoban.com/news/detail-753626.html

[root@localhost redis]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS               NAMES
b9f99c1d5fe1        redis               "docker-entrypoint..."   9 minutes ago       Restarting (1) 2 minutes ago                       m-redis
[root@localhost redis]# 

到了这里,关于Docker启动Redis容器时报错WARNING: The TCP backlog setting of 511 cannot be enforced的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包赞助服务器费用

相关文章

  • docker进入容器时报错 Error response from daemon: Container xxx is restarting, wait until the container is

    docker进入容器时报错 Error response from daemon: Container xxx is restarting, wait until the container is

    使用docker run命令运行容器,再进入容器时报错 运行容器命令 docker run --restart=always --name mongo -v /data/mongo:/data/db -p 27017:27017 -d mongo --auth 进入容器命令 docker exec -it mongo bash Error response from daemon: Container 90831dd80b32a1502d9535c874ceec899b5fd70c883481195b4f36cd29be47b0 is restarting, wait until the cont

    2024年02月11日
    浏览(14)
  • 解决docker运行redis报错:Fatal error, can‘t open config file /etc/redis/redis.conf以及启动redis后自动退出容器

    解决docker运行redis报错:Fatal error, can‘t open config file /etc/redis/redis.conf以及启动redis后自动退出容器

    现象如下:  看了报错是权限问题,然后发现redis1.conf的权限果然不大对, 所以运行 chmod o+r 添加权限 但是启动后容器自动退出: 然后把redis-server改成绝对路径/usr/local/bin/redis-server  此时就能发现报错真正的原因:是原始redis.conf配置文件内容的问题,而不是文件本身挂载的

    2024年02月04日
    浏览(34)
  • 使用ts-node命令运行ts文件时报错(Warning: To load an ES module, set “type“: “module“ in the package.json...)

    使用 ts-node 运行TS文件时报错。 错误信息1: 错误信息2: ts-node 版本: ^10.8.0 , typescript 版本: ^4.6.3 。 tsconfig.json 文件内容如下 在网上查找了一些资料,出现类似问题的有很多,链接如下: http://www.longant.cn/en/node/7289 https://stackoverflow.com/questions/62096269/cant-run-my-node-js-typescr

    2024年02月16日
    浏览(17)
  • docker启动mysql容器失败端口被占用Error starting userland proxy: listen tcp4 0.0.0.0:3306: bind: address already

    目录 前言 启动失败:端口被占用 解决办法: 方法一:杀死进程 方法二:修改端口映射,宿主机不使用3306  我的mysql镜像版本:8.0.31 我的启动命令为:  看错误信息得知该服务器的3306端口已经被占用了。一看果然是,我宿主机中的mysql正启动着,端口也是3306,不被占用才怪

    2024年02月12日
    浏览(12)
  • docker在删除容器或者镜像时报错

    linux:centos7 docker: 20.10.8 错误1:Error response from daemon: conflict: unable to remove repository reference “hello-world:latest” (must force) - container 258930df3ddc is using its referenced image bf756fb1ae65 错误2:unable to delete bdf60dc2ada3 (must be forced) - image is being used by stopped container e4b44cda2 linux使用docker安装n

    2024年02月15日
    浏览(11)
  • Docker 启动 elasticsearch报错OpenJDK 64-Bit Server VM warning:

    OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. 顶上的这段报错理论上不是报错, 就是一个 warning, 提醒你UseConcMarkSweepGC会在 v9.0 后弃用. 不是 Java 版本报错, 如果 java 版本不支持会在 logs 里面直接打出来的 不是 docker -d

    2024年02月11日
    浏览(63)
  • 【redis已解决】Warning: no config file specified, using the default config. In order to specify a config

    【redis已解决】Warning: no config file specified, using the default config. In order to specify a config

    Warning: no config file specified, using the default config. In order to specify a config file use /redis-6.2/redis-server /path/to/redis.conf 点击这个报错 表示没有指定配置文件,使用默认配置。要指定配置文件,请使用redis-server /path/to/redis.conf 启动成功 (如果你怕麻烦就使用批处理) redis-server.exe redis

    2024年02月16日
    浏览(9)
  • mysql启动时报错:Starting MySQL... ERROR! The server quit without updating PID file快速解决

    1、可能是/opt/mysql/data/数据目录mysql用户没有权限(修改数据目录的权限) 解决方法 :给予权限,执行 “chown -R mysql.mysql /opt/mysql/data” 然后重新启动mysqld 2、可能进程里已经存在mysql进程 解决方法:用命令“ps -ef|grep mysqld”查看是否有mysqld进程,如果有使用“kill -9 进程号”

    2024年02月08日
    浏览(48)
  • 运行docker镜像报错:WARNING: The requested image‘s platform (linux/amd64)的解决办法

    运行docker镜像时,报错: (1) WARNING: The requested image’s platform (linux/amd64) does not match the detected host platform (linux/386) and no specific platform was requested 原因: dockers镜像的系统架构类型和主机(虚拟机)的系统架构类型不一样 解决办法: docker可以通过 --platform = 系统架构 命令获取

    2024年02月11日
    浏览(11)
  • docker启动链接sqlservr的镜像时报SSl错误

    本次部署中遇到了老项目中的 net core 5.0 docker 镜像访问sql server 出现SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL.问题 这是由于服务器上sqlserver版本比较老,不支持TLSv1.2 而我部署的镜像默认使用的TLSv1.2,这是为了更高的安全性 解决方式: 注意: 由于项目配置文件里配置的端

    2024年02月05日
    浏览(12)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包