我正在尝试使用带有一些自定义cloud-init配置的CoreOS稳定AMI来设置EC2实例,但是遇到了一些问题。
#cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/5996f1b49fd642c5d1bc2f62cbff2fba
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
write_files:
- path: /etc/fleet/fleet.conf
content: |
public_ip="$private_ipv4"
metadata="elastic_ip=true,public_ip=$public_ipv4"上面的cloud-config运行得很好,但一旦我使用下面的cloud-config
#cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/5996f1b49fd642c5d1bc2f62cbff2fba
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
users:
- name: core
coreos-ssh-import-github: oba11
write_files:
- path: /etc/fleet/fleet.conf
content: |
public_ip="$private_ipv4"
metadata="elastic_ip=true,public_ip=$public_ipv4"或
#cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/5996f1b49fd642c5d1bc2f62cbff2fba
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
users:
- name: oba11
groups:
- sudo
- docker
coreos-ssh-import-github: oba11
write_files:
- path: /etc/fleet/fleet.conf
content: |
public_ip="$private_ipv4"
metadata="elastic_ip=true,public_ip=$public_ipv4"我不能再次以‘核心’用户身份使用我的aws密钥对或个人密钥SSH到coreos实例,并使用我的个人密钥创建用户'oba11‘。我也尝试了alpha AMI,但同样的问题。我不知道我是不是做错了什么。
非常感谢你的帮助。
发布于 2015-02-13 00:00:46
您正在使用陈旧的etcd发现令牌id。
一旦集群节点使用了这个id,这个令牌就被标记为已使用,如果由于某种原因没有etcd节点心跳到这个地址,这个令牌就会变得无用。
如果您尝试使用相同的etcd发现URI启动一个新的集群或单个节点,那么引导过程将失败。
在您的示例中,EC2节点将打开ssh服务,但它们将不会使用该云配置正确配置。
你正在经历的行为(连接但拒绝你的PK)是意料之中的,如果你没有读过https://coreos.com/docs/cluster-management/setup/cluster-discovery/上的文档,可能会引起头疼;
集群发现的另一个常见问题是尝试使用过时的发现URL启动新集群。如上所述,初始领导者选举被记录到URL中,这表明新的etcd实例应该加入现有集群。
如果您提供一个陈旧的发现URL,新机器将尝试连接到每个旧的对等地址,这将失败,因为它们不存在,并且引导过程将失败。
发布于 2015-01-29 10:35:12
我已经成功地启动了3个CoreOS机器集群,并且没有任何问题。使用您的配置。检查你的安全组,也许这就是问题所在。我用的是这个AMI ami-00158768
#cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/b0ac83415ff737c16670ce015a5d4eeb
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
users:
- name: gxela
groups:
- sudo
- docker
coreos-ssh-import-github: gxela
write_files:
- path: /etc/fleet/fleet.conf
content: |
public_ip="$private_ipv4"
metadata="elastic_ip=true,public_ip=$public_ipv4"https://stackoverflow.com/questions/25759093
复制相似问题