Skip to content
Snippets Groups Projects
Commit d212a68b authored by Michiel de Jong's avatar Michiel de Jong
Browse files

On ubuntu, run etcd as a systemd unit

parent 5b0ac206
No related branches found
No related tags found
No related merge requests found
To run an IndieHosters on ubuntu 14.10 (earlier versions will not work), run something like: To run an IndieHosters on ubuntu 14.10 (earlier versions will not work), run something like:
apt-get update && apt-get -y upgrade ````bash
dpkg-reconfigure -plow unattended-upgrades apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade
# set unattended upgrades to 'Yes' dpkg-reconfigure -plow unattended-upgrades
apt-get -y install systemd-sysv git docker.io # set unattended upgrades to 'Yes'
docker run -d --restart='always' -p 4001:4001 quay.io/coreos/etcd:v0.4.6 apt-get -y install systemd-sysv git docker.io
echo "#!/bin/sh" > /usr/local/etcdctl printf "#!/bin/sh\ndocker run --net=host quay.io/coreos/etcd:v0.4.6 /etcdctl $1 $2 $3 $4" >> /usr/local/etcdctl
echo "docker run --net=host quay.io/coreos/etcd:v0.4.6 /etcdctl $1 $2 $3 $4" >> /usr/local/etcdctl printf "[Unit]\nRequires=docker.service\nAfter=docker.service\n[Service]\nRestart=always\n\
shutdown -r now ExecStartPre=-/usr/bin/docker kill etcd\n\
ExecStartPre=-/usr/bin/docker rm etcd\n\
ExecStart=/usr/bin/docker run \
--name etcd \
-p 4001:4001 \
quay.io/coreos/etcd:v0.4.6\n\
ExecReload=/usr/bin/docker restart etcd\n\
ExecStop=/usr/bin/docker stop etcd\n\
[Install]\n\
WantedBy=multi-user.target\n" > /etc/systemd/system/etcd.service
shutdown -r now
````
systemctl start docker # This will be automatic once the IndieHosters unit-files are installed ````
systemctl list-units systemctl enable etcd
docker ps systemctl start etcd
etcdctl ls systemctl list-units
etcdctl help docker ps
etcdctl ls
etcdctl help
````
Now follow the [CoreOS-based instructions](deploying-a-server.md) Now follow the [CoreOS-based instructions](deploying-a-server.md)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment