简体   繁体   English

连接到网络失败,请确保您的网络选项正确并检查管理器日志:超出上下文期限

[英]attaching to network failed, make sure your network options are correct and check manager logs: context deadline exceeded

I am trying to use overlay network with docker-compose up (in swarm mode) because I need some other swarm to connect to that network as well.我正在尝试将覆盖网络与docker-compose up一起使用(在 swarm 模式下),因为我还需要一些其他的 swarm 来连接到该网络。

I am getting this error:我收到此错误:

ERROR: for elk_elasticsearch_1 Cannot start service elasticsearch: attaching to network failed, make sure your network options are correct and check manager logs: context deadline exceeded错误:对于 elk_elasticsearch_1 无法启动服务弹性搜索:连接到网络失败,请确保您的网络选项正确并检查管理器日志:超出上下文期限

ERROR: for elasticsearch Cannot start service elasticsearch: attaching to network failed, make sure your network options are correct and check manager logs: context deadline exceeded错误:对于弹性搜索无法启动服务弹性搜索:连接到网络失败,请确保您的网络选项正确并检查管理器日志:超出上下文期限

ERROR: Encountered errors while bringing up the project.错误:启动项目时遇到错误。

Here's my docker-compose:这是我的码头工人撰写:

networks:
  elk-network:
    attachable: true
    driver: overlay
    name: elk-network
services:
  elasticsearch:
    build:
      args:
        ELK_VERSION: 7.1.1
      context: /home/user/elk/elasticsearch
    environment:
      ELASTIC_PASSWORD: password
      ES_JAVA_OPTS: -Xmx256m -Xms256m
    networks:
      elk-network:
    ports:
    - published: 9200
      target: 9200
    - published: 9300
      target: 9300
    restart: always
    volumes:
    - /home/user/elk/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
    - /home/user/elk/data:/usr/share/elasticsearch/data:rw
  kibana:
    build:
      args:
        ELK_VERSION: 7.1.1
      context: /home/user/elk/kibana
    depends_on:
    - elasticsearch
    networks:
      elk-network:
    ports:
    - published: 5601
      target: 5601
    restart: always
    volumes:
    - /home/user/elk/kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
version: '3.5'

The node Spec.Availability says active.节点 Spec.Availability 表示活动。 I'm not finding any other information about what to do by googling the error.我没有通过谷歌搜索错误找到任何其他信息。

The network called elk-network actually shows up in docker network ls名为elk-network实际上出现在docker network ls

2l911valz0a8        elk-network              overlay             swarm

Edit: Another thing I've discovered from trying to debug is it works perfectly on my mac and on another server, but it doesn't work on the one server I need it to.编辑:我在尝试调试时发现的另一件事是它在我的 Mac 和另一台服务器上完美运行,但在我需要它的一台服务器上却无法运行。 Any way I can get more info about what's going on?有什么方法可以让我获得更多关于发生了什么的信息?

Perhaps you also need to play with the subnet parameters, gateway, IP ranges, etc.也许您还需要使用子网参数、网关、IP 范围等。

Example:例子:

docker network create -d overlay \
  --subnet=192.168.0.0/16 \
  --subnet=192.170.0.0/16 \
  --gateway=192.168.0.100 \
  --gateway=192.170.0.100 \
  --ip-range=192.168.1.0/24 \
  --aux-address="my-router=192.168.1.5" --aux-address="my-switch=192.168.1.6" \
  --aux-address="my-printer=192.170.1.5" --aux-address="my-nas=192.170.1.6" \
  elk-network

I solved my issue by uninstalling docker from snap and reinstalling using apt using these commands;我通过从 snap 中卸载 docker 并使用apt使用这些命令重新安装解决了我的问题;

sudo snap remove docker
sudo dpkg --configure -a
sudo apt update -y
sudo apt install docker.io
sudo reboot

After that, I was able to successfully create my network.之后,我能够成功创建我的网络。

I do the dpkg and update command to make sure my system is clean for re-install.我执行dpkgupdate命令以确保我的系统干净,可以重新安装。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 来自守护进程的错误响应:附加到网络失败,请确保您的网络选项正确并检查管理器日志:超出上下文截止时间 - Error response from daemon: attaching to network failed, make sure your network options are correct and check manager logs: context deadline exceeded Hyperledger 测试网络 - 无法创建新连接:超出上下文期限 - Hyperledger Test Network - failed to create new connection: context deadline exceeded 对独立容器使用覆盖网络会超出上下文截止期限 - Use an overlay network for standalone containers is throwing context deadline exceeded Docker 错误“无法连接到网络<name> : 超出上下文最后期限。”</name> - Docker error “Could not attach to network <name>: context deadline exceeded.” 对 peer0.org1.example.com:7051 的深度探测失败:超出上下文截止日期 - Deep probe of peer0.org1.example.com:7051 failed: context deadline exceeded Docker swarm leave --force - 超出上下文截止日期 - Docker swarm leave --force - context deadline exceeded Docker:来自守护进程的错误响应:附加到网络失败 - Docker: Error response from daemon: attaching to network failed 无法通过 NodeJS 查询/调用 Hyperledger Fabric Peers(在 docker swarm 网络中) - GRPC/S 截止日期错误 - Failed to query/invoke Hyperledger Fabric Peers(in a docker swarm network) via NodeJS - GRPC/S deadline Error 拉取镜像“docker4nitin/tg_bot:v2”失败:rpc 错误:code = Unknown desc = context deadline exceeded - Failed to pull image "docker4nitin/tg_bot:v2": rpc error: code = Unknown desc = context deadline exceeded 如何确保Docker容器具有所需的网络接口 - How to make sure the docker container has desired network interfaces
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM