使用 VMWare 虚拟机搭建了三个 Ubuntu20 系统,其中各自跑了 docker 服务,为了测试 swarm 集群
在 docker 中跑了 zookeeper 实例,一共 3 个,在没有挂起虚拟机的时候是正常的,也可以远程连接 zookeeper,但是如果挂起虚拟机,然后在重新运行虚拟机,就会出现 zookeeper 连不上其他实例的情况,然后截取了挂起前后的网卡配置情况,发现 docker0 和 docker swarm 默认创建的 docker-gwbridge 的 ip 地址没有了,各位大佬有没有什么解决方法呢?
挂起前
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:50:56:37:f4:94 brd ff:ff:ff:ff:ff:ff
inet 192.168.7.41/24 brd 192.168.7.255 scope global ens32
valid_lft forever preferred_lft forever
inet6 fe80::250:56ff:fe37:f494/64 scope link
valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:25:50:ec:63 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
4: docker_gwbridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:b8:64:0c:ff brd ff:ff:ff:ff:ff:ff
inet 172.18.0.1/16 brd 172.18.255.255 scope global docker_gwbridge
valid_lft forever preferred_lft forever
inet6 fe80::42:b8ff:fe64:cff/64 scope link
valid_lft forever preferred_lft forever
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:50:56:37:f4:94 brd ff:ff:ff:ff:ff:ff
inet 192.168.7.41/24 brd 192.168.7.255 scope global ens32
valid_lft forever preferred_lft forever
inet6 fe80::250:56ff:fe37:f494/64 scope link
valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:25:50:ec:63 brd ff:ff:ff:ff:ff:ff
4: docker_gwbridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:b8:64:0c:ff brd ff:ff:ff:ff:ff:ff
inet6 fe80::42:b8ff:fe64:cff/64 scope link
valid_lft forever preferred_lft forever