无法正确配置 CoreOS 集群
Can not configure CoreOS cluster properly
我卡在配置 CoreOS 集群上了。
我的 cloud_config 文件是两个 VM 的下一个文件:
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAA...
hostname: core001
coreos:
etcd2:
name: core001
discovery: https://discovery.etcd.io/86567bce070bd5316bdc9357ee2600de
# private networking need to use $public_ipv4:
advertise-client-urls: http://192.168.128.156:2379,http://192.168.128.156:4001
initial-advertise-peer-urls: http://192.168.128.156:2380
# listen on the official ports 2379, 2380 and one legacy port 4001:
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
listen-peer-urls: http://192.168.128.156:2380
fleet:
public-ip: 192.168.128.156
units:
- name: etcd2.service
command: start
- name: fleet.service
command: start
write_files:
- path: /etc/systemd/network/enp0s8.network
permissions: 0644
owner: root
content: |
[Match]
Name=enp0s8
[Network]
Address=192.168.128.156/22
Gateway=192.168.128.1
users:
- name: test
passwd: $yxV9YDKT$s.fAj5dlFyrPwrH0xAQJy/
groups:
- sudo
- docker
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1y...
hostname: core002
coreos:
etcd2:
name: core001
discovery: https://discovery.etcd.io/86567bce070bd5316bdc9357ee2600de
# private networking need to use $public_ipv4:
advertise-client-urls: http://192.168.128.157:2379,http://192.168.128.157:4001
initial-advertise-peer-urls: http://192.168.128.157:2380
# listen on the official ports 2379, 2380 and one legacy port 4001:
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
listen-peer-urls: http://192.168.128.157:2380
fleet:
public-ip: 192.168.128.157
units:
- name: etcd2.service
command: start
- name: fleet.service
command: start
write_files:
- path: /etc/systemd/network/enp0s8.network
permissions: 0644
owner: root
content: |
[Match]
Name=enp0s8
[Network]
Address=192.168.128.157/22
Gateway=192.168.128.1
users:
- name: test
passwd: $yxV9YDKT$s.fAj5dlFyrPwrH0xAQJy/
groups:
- sudo
- docker
我已经成功安装了两个节点,但是当我尝试 运行 时:
core@core001 ~ $ fleetctl list-machines
MACHINE IP METADATA
cd08747e... 192.168.128.156 -
我只有一台机器。第二个节点也一样:
core@core002 ~ $ fleetctl list-machines
MACHINE IP METADATA
753caf1b... 192.168.128.157 -
我怀疑 etcd 可能有问题,但是查阅了大量 google 参考资料 - 我没有发现任何对这种情况有用的东西。
你能帮我解决这个问题吗?
我刚刚开始学习 CoreOS,所以有些方面对我来说还不清楚。
提前致谢
您已经创建了两个独立的单节点 etcd 集群。 etcd 日志可能会提示原因。我想复制名称 core001
可能有所贡献。
我卡在配置 CoreOS 集群上了。
我的 cloud_config 文件是两个 VM 的下一个文件:
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAA...
hostname: core001
coreos:
etcd2:
name: core001
discovery: https://discovery.etcd.io/86567bce070bd5316bdc9357ee2600de
# private networking need to use $public_ipv4:
advertise-client-urls: http://192.168.128.156:2379,http://192.168.128.156:4001
initial-advertise-peer-urls: http://192.168.128.156:2380
# listen on the official ports 2379, 2380 and one legacy port 4001:
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
listen-peer-urls: http://192.168.128.156:2380
fleet:
public-ip: 192.168.128.156
units:
- name: etcd2.service
command: start
- name: fleet.service
command: start
write_files:
- path: /etc/systemd/network/enp0s8.network
permissions: 0644
owner: root
content: |
[Match]
Name=enp0s8
[Network]
Address=192.168.128.156/22
Gateway=192.168.128.1
users:
- name: test
passwd: $yxV9YDKT$s.fAj5dlFyrPwrH0xAQJy/
groups:
- sudo
- docker
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1y...
hostname: core002
coreos:
etcd2:
name: core001
discovery: https://discovery.etcd.io/86567bce070bd5316bdc9357ee2600de
# private networking need to use $public_ipv4:
advertise-client-urls: http://192.168.128.157:2379,http://192.168.128.157:4001
initial-advertise-peer-urls: http://192.168.128.157:2380
# listen on the official ports 2379, 2380 and one legacy port 4001:
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
listen-peer-urls: http://192.168.128.157:2380
fleet:
public-ip: 192.168.128.157
units:
- name: etcd2.service
command: start
- name: fleet.service
command: start
write_files:
- path: /etc/systemd/network/enp0s8.network
permissions: 0644
owner: root
content: |
[Match]
Name=enp0s8
[Network]
Address=192.168.128.157/22
Gateway=192.168.128.1
users:
- name: test
passwd: $yxV9YDKT$s.fAj5dlFyrPwrH0xAQJy/
groups:
- sudo
- docker
我已经成功安装了两个节点,但是当我尝试 运行 时:
core@core001 ~ $ fleetctl list-machines
MACHINE IP METADATA
cd08747e... 192.168.128.156 -
我只有一台机器。第二个节点也一样:
core@core002 ~ $ fleetctl list-machines
MACHINE IP METADATA
753caf1b... 192.168.128.157 -
我怀疑 etcd 可能有问题,但是查阅了大量 google 参考资料 - 我没有发现任何对这种情况有用的东西。
你能帮我解决这个问题吗?
我刚刚开始学习 CoreOS,所以有些方面对我来说还不清楚。
提前致谢
您已经创建了两个独立的单节点 etcd 集群。 etcd 日志可能会提示原因。我想复制名称 core001
可能有所贡献。