kkxxxxxxx
V2EX  ›  Docker

外网 tcping 不通容器端口

  •  
  •   kkxxxxxxx · Aug 19, 2017 · 4511 views
    This topic created in 3215 days ago, the information mentioned may be changed or developed.

    两台主机 CentOS 7 Docker 17.06 ce 每台主机上有若干 Apache 容器,正常运行大半年了, 最近随机出现某个容器端口连接不上的情况, 防火墙对应端口是放行的,内外网端口都可以正常访问

    出问题的时候通过内外网 tcping 端口检查: 内网 tcping localhost 端口 open 外网 tcping 网卡 ip 端口 open

    重启容器再次通过内外网 tcping 端口检查: 内网 tcping localhost 端口 open 外网 tcping 网卡 ip 端口 closed

    试过重建容器没有效果, 目前解决方法是要么更换出问题的端口,要么重启 Docker 服务

    请教下有其它比较彻底的解决方案或者建议没

    4 replies    2017-09-26 16:11:10 +08:00
    zuolan
        1
    zuolan  
       Aug 19, 2017
    保持关注。
    kkxxxxxxx
        2
    kkxxxxxxx  
    OP
       Aug 25, 2017
    出错时防火墙状态:
    firewalld[65391]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t nat -C DOCKER -p tcp -d 0/0 --dport 10001 -j DNAT --to-destination 192.168.144.2:80 ! -i br-f67cdc7b151e' failed:
    ypcs03
        3
    ypcs03  
       Sep 17, 2017 via Android
    出错是楼主有没有看看 docker daemon 的日志和内核的日志?
    kkxxxxxxx
        4
    kkxxxxxxx  
    OP
       Sep 26, 2017
    @ypcs03 没有找到内核日志,看了 docker logs:
    error: rsyslog:4 duplicate log entry for /var/log/messages
    error: skipping "/web/logs/access.log" because parent directory has insecure permissions...
    现在的解决方法是清除映射的日志目录文件,但还是不清楚什么原因引起的,时不时还是会发生
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1157 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 18:27 · PVG 02:27 · LAX 11:27 · JFK 14:27
    ♥ Do have faith in what you're doing.