Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions etcd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ curl -L https://github.com/coreos/etcd/releases/download/v2.3.3/etcd-v2.3.3-lin
tar xzvf etcd-v2.3.3-linux-amd64.tar.gz
cd etcd-v2.3.3-linux-amd64
sudo chmod a+x etcd
sudo cp etcd /usr/local/bin/etcd
sudo cp etcd /usr/local/bin/etcd
sudo mkdir /var/etcd

sudo echo "start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
cat > etcd.conf << 'EOF'
start on (net-device-up
and local-filesystems
and runlevel [2345])

respawn
stop on runlevel [016]

script
chdir /var/etcd
exec /usr/local/bin/etcd -name node1 -listen-peer-urls http://0.0.0.0:2380 -listen-client-urls http://0.0.0.0:2379,http://127.0.0.1:4001 -initial-advertise-peer-urls http://$ADVERTISE_ADDRESS:2380 -initial-cluster node1=http://$ADVERTISE_ADDRESS:2380 -initial-cluster-state new -initial-cluster-token etcd-cluster -advertise-client-urls http://$ADVERTISE_ADDRESS:2379 >>/var/log/etcd.log 2>&1
end script" >> etcd.conf
respawn

script
chdir /var/etcd
exec /usr/local/bin/etcd -name node1 -listen-peer-urls http://0.0.0.0:2380 -listen-client-urls http://0.0.0.0:2379,http://127.0.0.1:4001 -initial-advertise-peer-urls http://$ADVERTISE_ADDRESS:2380 -initial-cluster node1=http://$ADVERTISE_ADDRESS:2380 -initial-cluster-state new -initial-cluster-token etcd-cluster -advertise-client-urls http://$ADVERTISE_ADDRESS:2379 >>/var/log/etcd.log 2>&1
end script
EOF

sudo cp etcd.conf /etc/init/etcd.conf

Expand Down