Skip to content

Instantly share code, notes, and snippets.

@kelseyhightower
Created February 18, 2015 23:52
Show Gist options
  • Select an option

  • Save kelseyhightower/2b276bacc7ceec155dc0 to your computer and use it in GitHub Desktop.

Select an option

Save kelseyhightower/2b276bacc7ceec155dc0 to your computer and use it in GitHub Desktop.
[Unit]
Description=etcd
[Service]
User=etcd
PermissionsStartOnly=true
ExecStartPre=/usr/bin/wget -N -P /opt/bin http://192.168.0.1/etcd
ExecStartPre=/usr/bin/wget -N -P /opt/bin http://192.168.0.1/etcdctl
ExecStartPre=/usr/bin/chmod +x /opt/bin/etcd
ExecStartPre=/usr/bin/chmod +x /opt/bin/etcdctl
ExecStart=/opt/bin/etcd \
--name etcd2 \
--data-dir /var/lib/etcd \
--advertise-client-urls http://192.168.12.52:2379 \
--listen-client-urls http://192.168.12.52:2379 \
--initial-advertise-peer-urls http://192.168.12.52:2380 \
--listen-peer-urls http://192.168.12.52:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster etcd0=http://192.168.12.50:2380,etcd1=http://192.168.12.51:2380,etcd2=http://192.168.12.52:2380 \
--initial-cluster-state new
Restart=always
RestartSec=10s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment