Enable autostart of etcd service in CoreOS via systemd

I deployed a standalone CoreOS server with VMware image following this guide to try out CoreOS.

After a successful deployment, I found that my CoreOS only supports the Docker service, without starting, etc. and fleet services. Although I know how to use systemd to start etcd and fleet service manually. And I also know that using a cloud configuration can install CoreOS, which starts the etcd service and fleet.

But I want to know that:

  • Can I put a block file in /etc/systemd/systemso that the system starts the etcd service automatically?
  • If so, what is the contents of the unit file?
  • If it doesn’t work, what is it?

thank

+4
source share
2 answers
  • Yes. You must have the etcd.service and fleet.service services with the installation section. I added WantedBy = default.target to mine.

  • They are already hosted on coreos systems in / usr / lib 64 / systemd / system /. You can copy them to / etc / systemd / system /:

$ cp /usr/lib64/systemd/system/etcd.service / etc / systemd / system /
$ cp /usr/lib64/systemd/system/fleet.service / etc / systemd / system /
$ echo -e '[Install] \ nWantedBy = default.target >> /etc/systemd/system/fleet.service
$ echo -e '[Install] \ nWantedBy = default.target >> /etc/systemd/system/etcd.service
$ systemctl enable etcd.service
$ systemctl enable fleet.service

, , /etc/systemd/ , CoreOSs. /etc/systemd/ , systemd, init.

+5

- cloud-config. , VMware config-drive, .

, .

+2

All Articles