Thursday, December 10, 2015

Having fun with Etcd

0 lượt xem comment 0 comments

Etcd is a distributed, consistent key-value store for shared configuration and service discovery, with a focus on being. Etcd is very useful in DevOps context because today Immutable Infrastructure is one of the core principles. Often what people do is store the configs into a K/V store like Etcd and them just export OS_VARS into the OS level that could be an Amazon AMI, Linux or Bare metal, Mesos or even a Docker container.

One of the cool things about Etcd is that you have a pretty simple REST interface to operate over the K/V store.  When you are doing provisioning sometimes you need store IPs, IDS, Tags, etc... and this is very viable solution.

Having fun with Etcd

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
view raw etcd.md hosted with ❤ by GitHub
Cheers,
Diego Pacheco

Tags: no keyword

comment 0 comments

Chuyên mục văn hoá giải trí của VnExpress

.

© 2017 www.blogthuthuatwin10.com

Tầng 5, Tòa nhà FPT Cầu Giấy, phố Duy Tân, Phường Dịch Vọng Hậu, Quận Cầu Giấy, Hà Nội
Email: nguyenanhtuan2401@gmail.com
Điện thoại: 0908 562 750 ext 4548; Liên hệ quảng cáo: 4567.