我一直在配置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: $1$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: $1$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,因此我不清楚某些方面。

提前致谢

===============>>#1 票数:0 已采纳

您已经创建了两个单独的单节点etcd集群。 etcd日志可能会提示原因。 我猜想重复命名core001可能是有帮助的。

  ask by user54 translate from so

未解决问题?本站智能推荐: