Skip to content

Instantly share code, notes, and snippets.

@davistran86
Last active August 13, 2017 06:02
Show Gist options
  • Save davistran86/76b0284d70403fed95564ce2d5a2da5c to your computer and use it in GitHub Desktop.
Save davistran86/76b0284d70403fed95564ce2d5a2da5c to your computer and use it in GitHub Desktop.
cat > /tmp/my-etcd-1.service <<EOF
[Unit]
Description=etcd
Documentation=https://github.com/coreos/etcd
Conflicts=etcd.service
Conflicts=etcd2.service
[Service]
Type=notify
Restart=always
RestartSec=5s
LimitNOFILE=40000
TimeoutStartSec=0
ExecStart=/usr/bin/etcd --name my-etcd-1 \
--data-dir /var/lib/etcd \
--listen-client-urls http://0.0.0.0:2379 \
--advertise-client-urls http://0.0.0.0:2379 \
--listen-peer-urls http://0.0.0.0:2380 \
--initial-advertise-peer-urls http://k8s-master:2380 \
--initial-cluster my-etcd-1=http://k8s-master:2380 \
--initial-cluster-token my-etcd-token \
--initial-cluster-state new
[Install]
WantedBy=multi-user.target
EOF
sudo mv /tmp/my-etcd-1.service /etc/systemd/system/my-etcd-1.service
sudo systemctl daemon-reload
sudo systemctl enable my-etcd-1.service
sudo systemctl start my-etcd-1.service
#FOR MULTINODE: https://github.com/coreos/etcd/tree/master/contrib/systemd/etcd3-multinode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment