GVKun编程网logo

Docker Compose 报错 Failed to Setup IP tables(docker compose 报错 http)

14

本文将带您了解关于DockerCompose报错FailedtoSetupIPtables的新内容,同时我们还将为您解释dockercompose报错http的相关知识,另外,我们还将为您提供关于Ce

本文将带您了解关于Docker Compose 报错 Failed to Setup IP tables的新内容,同时我们还将为您解释docker compose 报错 http的相关知识,另外,我们还将为您提供关于Centos 7 使用(Service iptables stop/start)关闭/打开防火墙 Failed to stop iptables.service: Unit iptables.s...、centos7 docker 启动报错 Job for docker.service failed 解决办法、centos7 启动 iptables 时报 Job for iptables.service failed because the control process exited with error cod、Centos7 网络报错Job for iptables.service failed because the control process exited with error code.的实用信息。

本文目录一览:

Docker Compose 报错 Failed to Setup IP tables(docker compose 报错 http)

Docker Compose 报错 Failed to Setup IP tables(docker compose 报错 http)

详细信息如下:

[root@hecg docker-gitlab]# docker-compose up -d
Creating network "docker-gitlab_bridge" with driver "bridge"
ERROR: Failed to Setup IP tables: Unable to enable SKIP DNAT rule:  (iptables failed: iptables --wait -t nat -I DOCKER -i br-1b0d89adb807 -j RETURN: iptables: No chain/target/match by that name.
 (exit status 1))

查了资料,是因为防火墙修改后没有重启 Docker 服务,重启 Docker 服务后就好了:

## 重启docker
[root@hecg docker-gitlab]# systemctl restart docker

## 再次运行 ok
[root@hecg docker-gitlab]# docker-compose up -d
Creating network "docker-gitlab_bridge" with driver "bridge"
Creating docker-gitlab_gitlab_1 ... done

Centos 7 使用(Service iptables stop/start)关闭/打开防火墙 Failed to stop iptables.service: Unit iptables.s...

Centos 7 使用(Service iptables stop/start)关闭/打开防火墙 Failed to stop iptables.service: Unit iptables.s...

  背景: 

    测试部署NetCore 项目到linux 系统时,窗口显示项目部署成功;但是本机无法访问(linux 在虚拟机上[ centos 7.6] );  如下图↓

    

 

 

   能够相互ping  通,(Xshell 连接正常。),在centos 上 也能正常访问,后来记起在进行linux   安装成功后,没有关闭防火墙,初步猜测是由于没有关闭防火墙导致,那关闭防火墙不就可以了?

 二、操作

   1、打开linux 终端,输入:  service  iptables stop   ,就提示 标题展示的异常;

  

 

 

   2、然后输入:systemctl stop firewalld   (暂时关闭防火墙)

      查看防火墙状态:systemctl status firewalld   

  

 

 

  

  成功了!!!!

  三、回顾总结

    经过查找发现:在CentOS 7或RHEL 7或Fedora中防火墙由firewalld来管理 ; 如果想要使用 service iptables start/stop 命令,需要下载     iptables-services 

    1、在 Centos 7 下下载 iptables-services 时,需要执行以下命令

      systemctl stop firewalld     --关闭防火墙  

      systemctl mask firewalld   

       yum install iptables-services   --安装iptables-services

       systemctl enable iptables    --设置开机启动

      service iptables save       --保存

    2、操作linux 防火墙命令:      

1:查看防火状态
    systemctl status firewalld
    service  iptables status

2:暂时关闭防火墙
    systemctl stop firewalld
    service  iptables stop

3:永久关闭防火墙
    systemctl disable firewalld
    chkconfig iptables off

4:重启防火墙
    systemctl enable firewalld
    service iptables restart  

5:永久关闭后重启(未测试)
    chkconfig iptables on

 

查找资料:1、https://www.cnblogs.com/jxldjsn/p/10794171.html

     2、https://blog.csdn.net/c233728461/article/details/52679558/

 如有不合理之处,请大家多多指教。

    如果您觉得本文对您有帮助,欢迎点击“收藏”按钮!(/:微笑)欢迎转载,转载请注明出处。

 

centos7 docker 启动报错 Job for docker.service failed 解决办法

centos7 docker 启动报错 Job for docker.service failed 解决办法

启动  docker 报错

这里写图片描述

这里写图片描述

查看docker 版本,只有client,没有server。

这里写图片描述

解决方法:执行 vi /etc/sysconfig/selinux,把 selinux 属性值改为disabled。然后重启系统,docker就可以启动啦

这里写图片描述

这里写图片描述

docker 启动成功!

这里写图片描述

centos7 启动 iptables 时报 Job for iptables.service failed because the control process exited with error cod

centos7 启动 iptables 时报 Job for iptables.service failed because the control process exited with error cod

centos7启动iptables时报Job for iptables.service failed because the control process exited with error cod

启动iptables:

 service iptables start
报错如下:

Job for iptables.service failed because the control process exited with error code. See "systemctl status iptables.service" and "journalctl -xe" for details.
查看异常信息:
journalctl -xe
错误如下:

Failed to start IPv4 firewall with iptables.
解决办法
因为centos7默认的防火墙是firewalld防火墙,不是使用iptables,因此需要先关闭firewalld服务,或者干脆使用默认的firewalld防火墙。

因为这次报错的服务器是一台刚刚购买的阿里云服务器,所以在操作上忘记关闭默认防火墙的步骤了才导致浪费了些时间在这件事情上。

关闭firewalld:

 
systemctl stop firewalld
 
systemctl mask firewalld
使用iptables服务:

 
#开放443端口(HTTPS)
 
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
 
 
 
#保存上述规则
 
service iptables save
 
 
 
#开启服务
 
systemctl restart iptables.service
正常启动!!!!

 

Centos7 网络报错Job for iptables.service failed because the control process exited with error code.

Centos7 网络报错Job for iptables.service failed because the control process exited with error code.

今天在进行项目联系的时候,启动在待机的虚拟机,发现虚拟机的网络设置又出现了问题。

我以为像往常一样重启网卡服务就能成功,但是它却报了Job for iptables.service failed because the control process exited with error code。

后来在网上查找了一列方法进行尝试,虽然没有解决我的问题,但是也做一下记录:

  1. 打开任务管理器,先确定你的Vm服务有没有被停止,我开始弄了好一阵子才发现被停止了,虽然启动之后没有解决我的问题,但这种事情也很常见的。
  2. 修改位于/etc/sysconfig/network-scripts/ifcfg-ens33,一般的默认网卡都叫ens33,查看网卡的mac地址有没有或是否正确、没有可以加上HWADDR=(你的mac地址)
  3. 设定开机启动一个名为NetworkManager-wait-online服务,命令为:systemctl enable NetworkManager-wait-online.service  至于是为什么我也不太了解。

 

上面我试过的方法依然没有解决我的问题,后来在查找方法的时候找到了一些命令,顺利的解决了我的问题命令为:

chkconfig network off

chkconfig network on

service NetworkManager stop

service NetworkManager start

这里的意思是重新运行网络管理设置,在运行完毕后

敲如 ip a命令,发现网络一切恢复正常

 

今天关于Docker Compose 报错 Failed to Setup IP tablesdocker compose 报错 http的介绍到此结束,谢谢您的阅读,有关Centos 7 使用(Service iptables stop/start)关闭/打开防火墙 Failed to stop iptables.service: Unit iptables.s...、centos7 docker 启动报错 Job for docker.service failed 解决办法、centos7 启动 iptables 时报 Job for iptables.service failed because the control process exited with error cod、Centos7 网络报错Job for iptables.service failed because the control process exited with error code.等更多相关知识的信息可以在本站进行查询。

本文标签: