我在私有子网中启动5个coreos EC2成员。 然后为其中一个成员分配一个弹性IP。 似乎只有那个分配了ip的可以joinetcd2集群,并且永远在等待其他的4。
这是我的云configuration
#cloud-config coreos: update: reboot-strategy: "etcd-lock" etcd2: discovery: "https://discovery.etcd.io/_____hash_____" advertise-client-urls: "http://$private_ipv4:2379" initial-advertise-peer-urls: "http://$private_ipv4:2380" listen-client-urls: "http://0.0.0.0:2379,http://0.0.0.0:4001" listen-peer-urls: "http://$private_ipv4:2380,http://$private_ipv4:7001" fleet: public-ip: "$private_ipv4" metadata: "region=us-west" units: - name: "etcd2.service" command: "start" - name: "fleet.service" command: "start"
这里是公共ip的成员的错误
error #0: client: etcd member https://discovery.etcd.io returns server error [Gateway Timeout] waiting for other nodes: error connecting to https://discovery.etcd.io, retrying in 4m16s found self ae44c4332ec3c211 in the cluster found 1 peer(s), waiting for 4 more
其他4名成员并没有达到那么远
listening for peers on http://10.0.0.50:2380 listening for peers on http://10.0.0.50:7001 listening for client requests on http://0.0.0.0:2379 listening for client requests on http://0.0.0.0:4001 etcd2.service: Main process exited, code=exited, status=1/FAILURE Failed to start etcd2. etcd2.service: Unit entered failed state. etcd2.service: Failed with result 'exit-code'.
安全组入站规则
Custom TCP 7001 VPC subnet SSH TCP 22 0.0.0.0/0 Custom TCP 4001 VPC subnet Custom TCP 2379 VPC subnet Custom TCP 2380 VPC subnet
我已经在CoreOS稳定通道和Alpha通道中testing了这个
我最近遇到同样的问题。 看来公网地址并不像etcd2那样需要VPC中的Internet网关。 文档文档说:
确保子网中的实例具有公共IP地址或弹性IP地址。
我使用相同的设置启动群集,除了在创build实例时启用了“自动分配公共IP”
我不确定为什么每个成员都需要一个公共IP,因为他们只是在networking中宣传他们的$ private_ipv4。
——编辑——
我发现通过自动分配一个公共IP来“解决”的问题是,它现在实际上已经访问了互联网(https 443)
现在我知道了,我只把我所有的集群成员都连接到一个连接到NAT的私有子网上,现在就可以工作了。