Skip to content

Instantly share code, notes, and snippets.

@PierreKircher
Created April 7, 2015 19:43
Show Gist options
  • Save PierreKircher/de0523a4feade70ec095 to your computer and use it in GitHub Desktop.
Save PierreKircher/de0523a4feade70ec095 to your computer and use it in GitHub Desktop.
units:
- name: etcd.service
command: start
content: |
[Unit]
Description=etcd 2.0
Requires=docker.service
After=docker.service
Wants=network-online.target
After=network-online.target
[Service]
EnvironmentFile=/etc/environment
TimeoutStartSec=0
SyslogIdentifier=writer_process
ExecStartPre=-/usr/bin/docker kill etcd
ExecStartPre=-/usr/bin/docker rm etcd
ExecStartPre=/usr/bin/docker pull quay.io/coreos/etcd:v2.0.8
ExecStart=/bin/bash -c "/usr/bin/docker run \
-p 2379:2379 \
-p 2380:2380 \
-p 4001:4001 \
-v /usr/share/ca-certificates/:/etc/ssl/certs \
--net host \
--name etcd \
-v /var/lib/etcd:/opt/etcd \
quay.io/coreos/etcd:v2.0.8 \
-data-dir /opt/etcd \
-name %H \
-advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://$public_ipv4:2380 \
-listen-peer-urls http://$public_ipv4:2380 \
# -discovery https://discovery.etcd.io/12345693838asdfasfadf13939923 \
"
- path: /home/core/.bashrc
permissions: 0600
owner: core
content: |
export FLEETCTL_ENDPOINT=http://127.0.0.1:2379
export ETCDCTL_PEERS=http://127.0.0.1:2379
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment