azure - etcd 无法启动 - 供应商预设 : disabled

标签 azure vagrant coreos

使用此云配置来使用 vagrant 启动 coreos:

#cloud-config

coreos:
  etcd2:
    name: core-01
    initial-advertise-peer-urls: http://$private_ipv4:2380
    listen-peer-urls:
    http://$private_ipv4:2380,http://$private_ipv4:7001
    initial-cluster-token: core-01_etcd
    initial-cluster: core-01=http://$private_ipv4:2380
    initial-cluster-state: new
    advertise-client-urls:
    http://$public_ipv4:2379,http://$public_ipv4:4001
    listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
  fleet:
    public-ip: $public_ipv4
  flannel:
    interface: $public_ipv4
  units:
    - name: etcd2.service
      command: start
    - name: fleet.service
      command: start
    - name: flanneld.service
      drop-ins:
      - name: 50-network-config.conf
        content: |
          [Service]
          ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16" }'
      command: start
    - name: docker-tcp.socket
      command: start
      enable: true
      content: |
        [Unit]
        Description=Docker Socket for the API

        [Socket]
        ListenStream=2375
        Service=docker.service
        BindIPv6Only=both

        [Install]
        WantedBy=sockets.target

etcd 无法启动:

systemctl status etcd
● etcd.service - etcd
   Loaded: loaded (/usr/lib64/systemd/system/etcd.service; static; vendor preset: disabled)
   Active: inactive (dead)

我在没有云配置的情况下在 Azure 上启动 CoreOS VM,它给了我同样的错误。

最佳答案

查看服务启动模式:

systemctl list-unit-files | grep etcd

应该启用它。

如果它被“屏蔽”

systemctl unmask etcd.service

如果是“禁用”

systemctl enable etcd.service

在云配置文件中,我们看到需要更多服务。 所以你可以使用

systemctl edit etcd.service --full

并编辑此服务文件:

[Unit]
#Description=etcd...
#...
#After=network.target
#e.g. Start this Service before etcd.service
Wants=flanneld.service

有关更详细的 systemctl 描述,请参阅:

https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units
https://wiki.archlinux.org/index.php/Systemd

关于azure - etcd 无法启动 - 供应商预设 : disabled,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35503316/

相关文章:

c# - 如何在启用分区的情况下接收来自主题的消息

azure - AAD guest 用户不得成为帐户所有者

internet-explorer - 为什么微软要提供一个 Vagrant 版本的 IE 虚拟机?

mysql - 如何从 Vagrant box 连接到 docker 容器中的 MySQL 数据库?

amazon-web-services - CoreOS AWS userdata "docker run"启动时无法运行

docker - 如何创建基础CoreOS镜像并基于该镜像构建自定义父镜像

azure - 找不到就绪的 Helm 柄 pods (错误)

azure - 是否可以使用 Azure Devops API 访问组织范围的工件源?

command-line - 使用 Vagrant 的命令行为 CentOS 7 配置 Gnome 桌面

docker - Deis.io-如何调试未运行的应用程序?