etcd编译与简单使用
来源:互联网 发布:单片机在线编程 编辑:程序博客网 时间:2024/04/27 23:53
etcd是用go语言编写的
首先安装与配置go语言的环境
ubuntu1404安装go开发环境参考
http://xhrwang.me/2014/12/22/go-dev-env.html
http://go.ctolib.com/topics/3888.html
http://www.cnblogs.com/jytx/p/5447394.html
下载ectd源码构建
# go is required$ go versiongo version go1.6 darwin/amd64
# GOPATH should be set correctly$ echo $GOPATH/Users/example/go$ mkdir -p $GOPATH/src/github.com/coreos$ cd $GOPATH/src/github.com/coreos$ git clone https://github.com/coreos/etcd.git$ cd etcd$ ./build$ ./bin/etcd
测试安装
$ ./bin/etcdSet a key:$ ETCDCTL_API=3 ./bin/etcdctl put foo barOK
简单使用
export ETCDCTL_API=3$ ./bin/etcdctl put foo bar$ ./bin/etcdctl get foo$ ./bin/etcdctl get foo foo9$ ./bin/etcdctl del foo$ ./bin/etcdctl watch foo foo9# in another terminal: ./bin/etcdctl put foo barfoobar# in another terminal: ./bin/etcdctl put foo1 bar1foo1bar1$ ./bin/etcdctl compact 5compacted revision 5# any revisions before the compacted one are not accessible$ ./bin/etcdctl get --rev=4 fooError: rpc error: code = 11 desc = etcdserver: mvcc: required revision has been compacted# grant a lease with 10 second TTL$ ./bin/etcdctl lease grant 10lease 32695410dcc0ca06 granted with TTL(10s)# attach key foo to lease 32695410dcc0ca06$ ./bin/etcdctl put --lease=32695410dcc0ca06 foo barOK$ ./bin/etcdctl lease grant 10lease 32695410dcc0ca06 granted with TTL(10s)$ ./bin/etcdctl put --lease=32695410dcc0ca06 foo barOK$ ./bin/etcdctl lease revoke 32695410dcc0ca06lease 32695410dcc0ca06 revoked$ ./bin/etcdctl get foo# empty response since foo is deleted due to lease revocation$ ./bin/etcdctl lease grant 10lease 32695410dcc0ca06 granted with TTL(10s)$ ./bin/etcdctl lease keep-alive 32695410dcc0ca0lease 32695410dcc0ca0 keepalived with TTL(100)lease 32695410dcc0ca0 keepalived with TTL(100)lease 32695410dcc0ca0 keepalived with TTL(100)
0 0
- etcd编译与简单使用
- etcd的简单使用
- etcd的简单使用
- centos下 etcd 简单使用
- 使用Docker容器来源码编译etcd
- golang基础-etcd介绍与使用、etcd存取值、etcd监测数据写入
- gsoap编译与简单使用
- gsoap编译与简单使用
- gsoap编译与简单使用
- Etcd操作简单介绍
- etcd简单安装
- zookeeper与etcd
- zookeeper与etcd
- etcd 安装与管理
- python+etcd的使用
- etcd 使用入门
- ETCD 简介 + 使用
- etcd安装和使用
- CountDownLatch和CyclicBarrier的区别
- websocket 心跳连接
- Mac 系统下sublineText3 汉化步骤详解
- NOIP2016普及组复赛广东省一等奖名单及排名
- zookeeper配置出现的诸多问题
- etcd编译与简单使用
- velocity转义小问题
- 【洛谷P2194】 HXY烧情侣 强连通分量+tarjan+统计个数
- Java-编写界面记事本
- react-native中listview获取豆瓣书本信息并展示出来
- oracle树形查询
- 【NOIP2017提高组模拟12.10】神炎皇
- 统计字符串种类
- Linux下date命令,格式化输出,时间设置