etcd安装配置

http://ju.outofmemory.cn/entry/105412

Etcd是一个高可用的 Key/Value 存储系统,主要用于分享配置和服务发现。
简单:支持 curl 方式的用户 API (HTTP+JSON)
安全:可选 SSL 客户端证书认证
快速:单实例可达每秒 1000 次写操作
可靠:使用 Raft 实现分布式

下载安装etcd

[root@localhost ~]# wget https://github.com/coreos/etcd/releases/download/v0.4.6/etcd-v0.4.6-linux-amd64.tar.gz
[root@localhost ~]# tar -zxvf etcd-v0.4.6-linux-amd64.tar.gz
[root@localhost ~]# cd etcd-v0.4.6-linux-amd64
[root@localhost etcd-v0.4.6-linux-amd64]# cp etcd* /bin/
[root@localhost ~]# etcd -version
etcd version 0.4.6

简单操作

letong@me:~$ curl -L http://192.168.0.123:4001/v2/keys/lekey -XPUT -d value=”this is key”  #添加
{“action”:”set”,”node”:{“key”:”/lekey”,”value”:”this is key”,”modifiedIndex”:4,”createdIndex”:4}}

letong@me:~$ curl -L http://192.168.0.123:4001/v2/keys/lekey #查询
{“action”:”get”,”node”:{“key”:”/lekey”,”value”:”this is key”,”modifiedIndex”:4,”createdIndex”:4}}

letong@me:~$ curl -L http://192.168.0.123:4001/v2/keys/lekey -XDELETE #删除
{“action”:”delete”,”node”:{“key”:”/lekey”,”modifiedIndex”:5,”createdIndex”:4},”prevNode”:{“key”:”/lekey”,”value”:”this is key”,”modifiedIndex”:4,”createdIndex”:4}}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值