Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Last active November 18, 2018 18:43
Show Gist options
  • Save diegopacheco/5193bb0dafac9e097759 to your computer and use it in GitHub Desktop.
Save diegopacheco/5193bb0dafac9e097759 to your computer and use it in GitHub Desktop.
How to Build and Install Etcd on Amazon Linux / CentOS?

Install Go and git, Download Etcd from github and build

sudo yum install -y golang git
go version
sudo git clone https://github.com/coreos/etcd
cd etcd
sudo ./build

Add etcd on path on ~/.bashrc

sudo vim ~/.bashrc
export PATH=$PATH:/home/ec2-user/etcd/bin
ESC + : + wq! + ENTER

Source ~/.bashrc

source  vim ~/.bashrc

Check

etcd
etcdctl -v
curl -L http://127.0.0.1:2379/version

etcdctl set /message Hello
etcdctl get /message

set /message4 Hello --ttl 5
curl http://127.0.0.1:2379/v2/keys/

etcdctl mkdir /root
etcdctl set /root/k1 127.0.0.1
etcdctl set /root/k2 127.0.0.2
etcdctl set /root/k3 127.0.0.3
etcdctl ls /root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment