系统集成DockerflannelEtcd

Docker使用etcd配置flannel网络失败

测试环境:master:192.168.66.40,启动etcd服务node1: 192.168.66.41node2: 192.168.66.421.在master上正常开启etcd服务[root@docker-manager flannel]# etcdctl --endpoints=192.168.66.40:2379 get /docker-test/network/config/docker-test/network/config{    "Network...显示全部

测试环境:
master:192.168.66.40,启动etcd服务
node1: 192.168.66.41
node2: 192.168.66.42

1.在master上正常开启etcd服务
[root@docker-manager flannel]# etcdctl --endpoints=192.168.66.40:2379 get /docker-test/network/config
/docker-test/network/config
{
    "Network": "192.168.88.0/16",
    "SubnetLen":24,
    "Backend": {
        "Type": "vxlan"
    }
}

2.在node1上执行curl
命令可以获得etcd版本信息,可以证明2个服务器之间的连通性以及etcd服务都没有问题
[root@docker1 ~]# curl http://192.168.66.40:2379/version
{"etcdserver":"3.4.15","etcdcluster":"3.4.0"}[root@docker1 ~]#

3.在node1上运行flannel服务
flanneld -etcd-endpoints=http://192.168.66.40:2379 -iface=ens38 -etcd-prefix=/docker-test/network/config

报错信息如下:
[root@docker1 ~]# flanneld -etcd-endpoints=http://192.168.66.40:2379 -iface=ens38 -etcd-prefix=/docker-test/network/config
I0302 16:56:17.115553   16966 main.go:531] Using interface with name ens38 and address 192.168.66.41
I0302 16:56:17.115632   16966 main.go:548] Defaulting external address to interface address (192.168.66.41)
I0302 16:56:17.115712   16966 main.go:246] Created subnet manager: Etcd Local Manager with Previous Subnet: None
I0302 16:56:17.115718   16966 main.go:249] Installing signal handlers
E0302 16:56:17.119316   16966 main.go:386] Couldn't fetch network config: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.
timed out
E0302 16:56:18.122950   16966 main.go:386] Couldn't fetch network config: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.
timed out
E0302 16:56:19.125532   16966 main.go:386] Couldn't fetch network config: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.
timed out
E0302 16:56:20.128169   16966 main.go:386] Couldn't fetch network config: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.
timed out
E0302 16:56:21.131232   16966 main.go:386] Couldn't fetch network config: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.
timed out
E0302 16:56:22.136389   16966 main.go:386] Couldn't fetch network config: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.
timed out
E0302 16:56:23.140187   16966 main.go:386] Couldn't fetch network config: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.

收起
参与7

回答者

沈天真
售前支持IPS
擅长领域: 服务器云计算存储

沈天真 最近回答过的问题

回答状态

  • 发布时间:2021-03-03
  • 关注会员:4 人
  • 回答浏览:2775
  • X社区推广