Note that any key that was created using the v2 API will not be able to be queried via the v3 API. A v3 API etcdctl get of a v2 key will exit with 0 and no key data, this is the expected behaviour.

export ETCDCTL_API=3

etcdctl version

1、etcdctl put foo bar

2、etcdctl put foo1 bar1 --lease=1234abcd(创建的租约ID)

3、etcdctl get foo

4、etcdctl get foo --hex

5、$ etcdctl get --prefix foo

foo bar

foo1 bar1

foo2 bar2

foo3 bar3

6、etcdctl get --prefix --limit=2 foo

7、版本,每次修订KEY,都会全局版本加一

Suppose an etcd cluster already has the following keys:

foo = bar         # revision = 2
foo1 = bar1 # revision = 3
foo = bar_new # revision = 4
foo1 = bar1_new # revision = 5

Here are an example to access the past versions of keys:

$ etcdctl get --prefix foo # access the most recent versions of keys
foo
bar_new
foo1
bar1_new $ etcdctl get --prefix --rev=4 foo # access the versions of keys at revision 4
foo
bar_new
foo1
bar1 $ etcdctl get --prefix --rev=3 foo # access the versions of keys at revision 3
foo
bar
foo1
bar1 $ etcdctl get --prefix --rev=2 foo # access the versions of keys at revision 2
foo
bar $ etcdctl get --prefix --rev=1 foo # access the versions of keys at revision 1 8、读取》=KEY

Suppose an etcd cluster already has the following keys:

a = 123
b = 456
z = 789

Here is the command to read keys which are greater than or equal to the byte value of key b :

$ etcdctl get --from-key b
b
456
z
789 9、etcdctl  del foo1 foo9--范围删除
10、$ etcdctl del --prev-kv zoo

Here is the command to delete key zoo with the deleted key value pair returned

1   # one key is deleted
zoo # deleted key
val # the value of the deleted key 11、$ etcdctl del --from-key b

Here is the command to delete keys which are greater than or equal to the byte value of key b :

   2 # two keys are deleted
 


ETCD的常用命令的更多相关文章

  1. etcd常用命令记录

    etcd常用命令记录   1.查看etcd的版本 [root@etcd01 ssl]# curl -L http://127.0.0.1:2379/version {"etcdserver& ...

  2. ETCD快速入门-03 常用命令

    3. ETCD 常用命令     etcdctl是一个命令行的客户端,它提供了一些命令,可以方便我们在对服务进行测试或者手动修改数据库内容.etcdctl与kubectl和systemctl的命令原理 ...

  3. [转帖]linux中systemctl详细理解及常用命令

    linux中systemctl详细理解及常用命令 2019年06月28日 16:16:52 思维的深度 阅读数 30 https://blog.csdn.net/skh2015java/article ...

  4. linux中systemctl详细理解及常用命令

    linux中systemctl详细理解及常用命令 https://blog.csdn.net/skh2015java/article/details/94012643 一.systemctl理解 Li ...

  5. 史上最全的Kuberenetes 常用命令手册

    1.0 k8s 集群状态检查 # 查看集群信息 kubectl cluster-info systemctl status kube-apiserver systemctl status kubele ...

  6. Windows下安装kubectl及Node和Pod操作常用命令

    kubernetes通过kube-apiserver作为整个集群管理的入口.Apiserver是整个集群的主管理节点,用户通过Apiserver配置和组织集群,同时集群中各个节点同etcd存储的交互也 ...

  7. 使用kubectl管理Kubernetes(k8s)集群:常用命令,查看负载,命名空间namespace管理

    目录 一.系统环境 二.前言 三.kubectl 3.1 kubectl语法 3.2 kubectl格式化输出 四.kubectl常用命令 五.查看kubernetes集群node节点和pod负载 5 ...

  8. Linux 常用命令(持续补充)

    常用命令: command &:将进程放在后台执行 ctrl + z:暂停当前进程 并放入后台 jobs:查看当前后台任务 bg( %id):将任务转为后台执行 fg( %id):将任务调回前 ...

  9. LVM基本介绍与常用命令

    一.LVM介绍LVM是 Logical Volume Manager(逻辑卷管理)的简写,它是Linux环境下对磁盘分区进行管理的一种机制LVM - 优点:LVM通常用于装备大量磁盘的系统,但它同样适 ...

随机推荐

  1. 关于python 的 __future__

    经常看到__future__: from __future__ import absolute_importfrom __future__ import print_functionfrom __fu ...

  2. SpringMVC-时间类型转换

    在上一篇SpringMVC的提交表单中,我们使用的日期为String型,可以将日期转换为Date型,然后使用initBinder函数进行显示,具体代码如下: (1)首先更改User.java的birt ...

  3. AC3 exponent coding

    1.overview AC-3编码的audio信号中的频率系数由浮点型数据表示,并将其归一化到0~1之间. transform coefficient由exponent和mantissa组成. 设tr ...

  4. 网络、芯片、专利、产业链……影响5G手机走势的因素有哪些?

    近段时间,备受关注的5G手机迎来一个爆发的小高潮.中国质量认证中心官网显示8款5G手机获得3C认证.其中华为有4款 ,一加.中兴.OPPO和vivo各有一款5G手机获得3C认证.随后在7月23日,中兴 ...

  5. redis 解决秒杀

    # import redis pool = redis.ConnectionPool(host = '127.0.0.1', port=6379, db=0)#创建连接池 r = redis.Redi ...

  6. 微信公众号获取access_token

    一般我们在进行微信公众号开发的时候,都需要用到access_token,但是具体的获取及其使用方式如何呢?下面展示一种获取的方式(具体的微信公众号申请和配置,请参考开放文档,具体在这里就不详细说明了) ...

  7. php基础扫盲

    .

  8. JS高级---复习

    复习 面向过程和面向对象都是编程的思想, 方式不一样 面向过程: 凡事都是亲力亲为, 所有的代码都要自己写, 每一步都要很清楚, 注重的是过程 面向对象: 执行者成为指挥者, 只要找对象, 然后让对象 ...

  9. Codeforces Round #618 (Div. 1)C(贪心)

    把所有数看作N块,后面的块比前面的块小的话就合并,这个过程可能会有很多次,因为后面合并后会把前面的块均摊地更小,可能会影响更前面地块,像是多米诺骨牌效应,从后向前推 #define HAVE_STRU ...

  10. C#中的注释

    帮助程序员便于阅读代码 单行注释 // 多行注释 /* * */ 文档注释 /// <summary> /// ... /// <summary>