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. Linux - Shell - find - 进阶: 时间与大小

    概述 继续 find 这次的内容, 参数稍微要 复杂那么一丢丢 背景 刚学会了 基础 的参数 现在来了解一些 时间 和 空间 的参数 一说到操控时间空间, 感觉立马起来了... 准备 OS cento ...

  2. mysql基本约定与命名规范

    一.约定 1.如无特殊需求,所有表使用innodb引擎 2.如无特殊需求,所有主键均为自增类型 3.如无特殊需求,所有字段均为NOT NULL,并给定默认值 4.所有字段均设置备注,枚举字段需要说明每 ...

  3. hadoop学习笔记(十):hdfs在命令行的基本操作命令(包括文件的上传和下载和hdfs中的文件的查看等)

    hdfs命令行 ()查看帮助 hdfs dfs -help ()查看当前目录信息 hdfs dfs -ls / ()上传文件 hdfs dfs -put /本地路径 /hdfs路径 ()剪切文件 hd ...

  4. 【做题笔记】P1330 封锁阳光大学

    读题易得:对于有边的两个点 \(u,v\) ,能且仅能其中一点对这条边进行封锁. 什么意思呢?假设给这张图上的点进行染色,那么对于上述的两个点 \(u,v\) ,\(u,v\) 必须异色(理解这一点很 ...

  5. Mysql sql语句技巧与优化

    一.常见sql技巧 1.正则表达式的使用 2.巧用RAND()提取随机行 mysql数据库中有一个随机函数rand()是获取一个0-1之间的数,利用这个函数和order by一起能够吧数据随机排序, ...

  6. linux用字符模式修改权限

    -rw-r--r--  tt.htm 从第二个字符起rw是说用户apple有读.写权,没有运行权,接着的r--表示用户组users只有读权限,没有运行权,最后的r--指其他人 (others)只有读权 ...

  7. zxEditor

    <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="X-UA-C ...

  8. Platform device/driver注册过程

    Platform是一种虚拟总线,Platform机制将设备本身的资源注册进内核,有内核统一管理,在驱动程序使用这些资源时使用统一的接口,这样提高了程序的可移植性. Linux的大部分设备驱动都可以使用 ...

  9. MySQL 整型

    MySQL中我们建表的时候,类型可以用bigint(20), 这是什么意思呢? 首先我们看bigint, MySQL的整型类型有这样几种: 类型      占用字节 tinyint        1 ...

  10. kafka集群搭建记录

    本文记录搭建kafka搭建过程. 一.硬件机器介绍 192.168.183.195 master-node 192.168.183.194 data-node1 192.168.183.196 dat ...