Skip to content

Instantly share code, notes, and snippets.

@kelseyhightower
Created March 4, 2015 21:28
Show Gist options
  • Save kelseyhightower/263ca77433cce3a298fb to your computer and use it in GitHub Desktop.
Save kelseyhightower/263ca77433cce3a298fb to your computer and use it in GitHub Desktop.
var systemdUnitTemplate = `
[Unit]
Description=etcd
[Service]
Environment=ETCD_NAME={{.Name}}
Environment=ETCD_DATA_DIR={{.DataDir}}
Environment=ETCD_ADVERTISE_CLIENT_URLS={{.AdvertiseClientUrls}}
Environment=ETCD_LISTEN_CLIENT_URLS={{.ListenClientUrls}}
Environment=ETCD_INITIAL_ADVERTISE_PEER_URLS=http://{{.PrivateIP}}:2380
Environment=ETCD_LISTEN_PEER_URLS=http://{{.PrivateIP}}:2380
Environment=ETCD_INITIAL_CLUSTER_TOKEN=etcd-cluster-1
Environment=ETCD_INITIAL_CLUSTER={{.InitialCluster}}
Environment=ETCD_INITIAL_CLUSTER_STATE=new
Environment=GOMAXPROCS=2
ExecStart=/opt/etcd/bin/etcd
Restart=always
RestartSec=10s
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment