Docker:无法使用Windows容器中的叠加层在节点之间进行ping操作

时间:2019-03-25 03:40:30

标签: docker docker-swarm docker-windows

我想从工作节点(使用VMware的Windows Server 2016)到管理节点(Windows 10专业版主机)进行ping

两者都在Windows容器中运行,并且基本映像是Windows服务器核心。

在两个节点上禁用防火墙和实时保护。

我的步骤: 1.我初始化了集群:  docker swarm init --advertise-addr 10.2.40.56 --listen-addr 10.2.40.56:2377

  1. 复制令牌在我的工作节点(VMware)上运行它: docker swarm join --token xxx 10.2.40.56:2377

  2. 创建我的覆盖网络: 泊坞窗网络创建-d覆盖oscnetwork docker network ls

NETWORK ID          NAME                DRIVER              SCOPE
d3d31701c63c        Default Switch      ics                 local
223b63c174a6        MyNewVM             transparent         local
kkg48ht1mm2i        ingress             overlay             swarm
0502c3c90154        nat                 nat                 local
398e644b974d        none                null                local
0c57431eex76        oscnetwork          overlay             swarm
  1. 节点检查:

docker节点ls

ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
x743m4s7e88teo8r556pps7x0 *   DESKTOP-MND1RMF     Ready               Active              Leader              18.09.2
q5khhc9sxtx2arq5vnzk1ff1g     WIN-O80KBT0ALHF     Ready               Active                                  18.09.3  

5。为经理和工作人员创建服务:

docker服务create --name testService --network oscnetwork --replicas 2 -t mcr.microsoft.com/windows/servercore

fex0sohv28dbrrweknuieal6o
overall progress: 2 out of 2 tasks
1/2: running   [==================================================>]
2/2: running   [==================================================>]
verify: Service converged

6。服务检查: docker服务ls

ID                  NAME                MODE                REPLICAS            IMAGE                                         PORTS
fex0sohv28db        testService         replicated          2/2                 mcr.microsoft.com/windows/servercore:latest

C:\WINDOWS\system32>docker service ps testService
ID                  NAME                IMAGE                                         NODE                DESIRED STATE       CURRENT STATE            ERROR               PORTS
fui0wmz53y6n        testService.1       mcr.microsoft.com/windows/servercore:latest   DESKTOP-MND1RMF     Running             Running 29 seconds ago
3y7onvm565eb        testService.2       mcr.microsoft.com/windows/servercore:latest   WIN-O80KBT0ALHF     Running             Running 38 seconds ago

检查管理器节点的ipv4: 码头工人网络检查oscnetwork

[
    {
        "Name": "oscnetwork",
        "Id": "0c57431eex769r8hrb6shipk6",
        "Created": "2019-03-25T10:09:08.6121437+08:00",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.0.0.0/24",
                    "Gateway": "10.0.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "58d2401f966e38ef0d587749d0fc4e0ef8788ff35ce313941db7ac479bf918d9": {
                "Name": "testService.1.fui0wmz53y6n4nnmpcpimyvq7",
                "EndpointID": "3233c31e4f628d81b7dad518a46aa7ff0df59fc2eeb6d66852cb10c34e5a59b3",
                "MacAddress": "00:15:5d:53:a0:71",
                "IPv4Address": "10.0.0.3/24",
                "IPv6Address": ""
            },
            "lb-oscnetwork": {
                "Name": "oscnetwork-endpoint",
                "EndpointID": "60c81c70081fdedfd56985575d9493ecd74a2ec75bc5c1e8f5e46c8a2c62ccd4",
                "MacAddress": "00:15:5d:53:a9:3c",
                "IPv4Address": "10.0.0.5/24",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4097",
            "com.docker.network.windowsshim.hnsid": "12B5FFA3-73B7-4CE6-BB63-7EAC7AC39324"
        },
        "Labels": {},
        "Peers": [
            {
                "Name": "64f325a8ceda",
                "IP": "10.2.40.57"
            },
            {
                "Name": "8b4ea8ba1b4c",
                "IP": "10.2.40.56"
            }
        ]
    }
] 

检查工作人员的ipv4: 码头工人网络检查oscnetwork

[
    {
        "Name": "oscnetwork",
        "Id": "0c57431eex769r8hrb6shipk6",
        "Created": "2019-03-25T10:09:08.6163688+08:00",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.0.0.0/24",
                    "Gateway": "10.0.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "7b0fc57b716e9500eb32ae546d27ecc9365f1de3188b919c5e9409d09c7e8606": {
                "Name": "testService.2.3y7onvm565eb222sfp9cn39lx",
                "EndpointID": "3e0efc7eb29fb20f03053ef557e0a1109f89654a8d67c0c560215b80840f4f75",
                "MacAddress": "00:15:5d:6f:46:bf",
                "IPv4Address": "10.0.0.4/24",
                "IPv6Address": ""
            },
            "lb-oscnetwork": {
                "Name": "oscnetwork-endpoint",
                "EndpointID": "8dea6242065a1bfaf74a4d09d6251cd3cb48a9d727b17f21554b78f4a5d9c478",
                "MacAddress": "00:15:5d:6f:4c:e5",
                "IPv4Address": "10.0.0.6/24",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4097",
            "com.docker.network.windowsshim.hnsid": "62dee47e-3119-4b94-b279-8d3219575a62"
        },
        "Labels": {},
        "Peers": [
            {
                "Name": "64f325a8ceda",
                "IP": "10.2.40.57"
            },
            {
                "Name": "8b4ea8ba1b4c",
                "IP": "10.2.40.56"
            }
        ]
    }
]

在我的工作节点下(正​​在运行的容器): ping 10.0.0.3

输出: 使用32个字节的数据ping 10.0.0.3: 请求超时。 请求超时。 请求超时。 请求超时。

10.0.0.3的Ping统计信息:     数据包:已发送= 4,已接收= 0,已丢失= 4(丢失100%),

预期输出”:能够发送数据包。

使用的端口:

 TCP    10.2.40.56:2377        DESKTOP-MND1RMF:0      LISTENING
 [dockerd.exe]
  TCP    10.2.40.56:2377        WIN-O80KBT0ALHF:52770  ESTABLISHED
 [dockerd.exe]
  TCP    10.2.40.56:7946        DESKTOP-MND1RMF:0      LISTENING
 [dockerd.exe]
  TCP    10.2.40.56:7946        WIN-O80KBT0ALHF:53237  TIME_WAIT
  TCP    10.2.40.56:7946        WIN-O80KBT0ALHF:53241  TIME_WAIT
  TCP    10.2.40.56:7946        WIN-O80KBT0ALHF:53244  TIME_WAIT
  TCP    10.2.40.56:7946        WIN-O80KBT0ALHF:53247  TIME_WAIT
  TCP    10.2.40.56:55784       13.89.187.212:https    ESTABLISHED
  WpnService
 [svchost.exe]

我不知道出了什么问题。如果有人可以帮助我,将不胜感激。谢谢。

0 个答案:

没有答案