etcdctl 使用说明
来源:互联网 发布:cs1.6显示网络 编辑:程序博客网 时间:2024/06/06 07:20
目的
了解 etcd 连接了解 etcd 增删改查方法
概念
etcd 以 key-value 方式进行值的存储, 用于配置共享和服务发现
结构
etcd 可以创建, 删除目录, 用于区分保存不同的信息key-volume 可以直接存取到 etcd 集群中同理, key-value 可以保存到不同目录中key 被保存到 btree 中, 方便进行搜索与获取
api-version
当前 etcdctl 支持 ETCDCTL-API=2 ETCDCTL_API=3 两种不同的操作类型
不同的 api 类型使用的命令参数不一样
通过环境变量切换方法定义当前 api 类型
version2
[root@terry ~]# etcdctl --helpNAME: etcdctl - A simple command line client for etcd.USAGE: etcdctl [global options] command [command options] [arguments...]VERSION: 3.2.7COMMANDS: backup backup an etcd directory cluster-health check the health of the etcd cluster mk make a new key with a given value mkdir make a new directory rm remove a key or a directory rmdir removes the key if it is an empty directory or a key-value pair get retrieve the value of a key ls retrieve a directory set set the value of a key setdir create a new directory or update an existing directory TTL update update an existing key with a given value updatedir update an existing directory watch watch a key for changes exec-watch watch a key for changes and exec an executable member member add, remove and list subcommands user user add, grant and revoke subcommands role role add, grant and revoke subcommands auth overall auth controls help, h Shows a list of commands or help for one command
version3
[root@terry ~]# export ETCDCTL_API=3[root@terry ~]# etcdctl --helpNAME: etcdctl - A simple command line client for etcd3.USAGE: etcdctlVERSION: 3.2.7API VERSION: 3.2COMMANDS: get Gets the key or a range of keys put Puts the given key into the store del Removes the specified key or range of keys [key, range_end) txn Txn processes all the requests in one transaction compaction Compacts the event history in etcd alarm disarm Disarms all alarms alarm list Lists all alarms defrag Defragments the storage of the etcd members with given endpoints endpoint health Checks the healthiness of endpoints specified in `--endpoints` flag endpoint status Prints out the status of endpoints specified in `--endpoints` flag watch Watches events stream on keys or prefixes version Prints the version of etcdctl lease grant Creates leases lease revoke Revokes leases lease timetolive Get lease information lease keep-alive Keeps leases alive (renew) member add Adds a member into the cluster member remove Removes a member from the cluster member update Updates a member in the cluster member list Lists all members in the cluster snapshot save Stores an etcd node backend snapshot to a given file snapshot restore Restores an etcd member snapshot to an etcd directory snapshot status Gets backend snapshot status of a given file make-mirror Makes a mirror at the destination etcd cluster migrate Migrates keys in a v2 store to a mvcc store lock Acquires a named lock elect Observes and participates in leader election auth enable Enables authentication auth disable Disables authentication user add Adds a new user user delete Deletes a user user get Gets detailed information of a user user list Lists all users user passwd Changes password of user user grant-role Grants a role to a user user revoke-role Revokes a role from a user role add Adds a new role role delete Deletes a role role get Gets detailed information of a role role list Lists all roles role grant-permission Grants a key to a role role revoke-permission Revokes a key from a role check perf Check the performance of the etcd cluster help Help about any command
增删改查
注意,
当前文档使用 centos 7 rpm 软件( etcd-3.2.7-1.el7.x86_64 及 etcd-3.0.15-1.el7.x86_64 )
在增删改查上, 官档主要介绍 api-version=3 版本的使用方法
参考 etcd 最新说明文档
连接 etcd
利用 etcdctl 命令进行连接本地连接, 默认使用 http://127.0.0.1:2379 作为默认 endpoint假如需要执行远程连接, 可以通过定义 endpoint 实现ex: etcd --endpoint http://10.199.205.229:2379
阅读全文
0 0
- etcdctl 使用说明
- 使用 etcdctl
- etcdctl exec-watch 命令使用介绍
- 使用说明
- 使用说明
- 如何使用Etcdctl与Etcd——CoreOS的分布式键-值存储
- smtp使用说明
- Jam 使用说明
- Itext使用说明
- Exe4j 使用说明
- TortoiseSVN使用说明
- FVWM使用说明
- Jmail 使用说明
- Vi 使用说明
- Eclipse使用说明
- vi使用说明
- ubb使用说明
- sprintf()使用说明
- Android蓝牙开发与蓝牙模块进行通讯(基于eclipse)
- 属性动画
- PostgreSQL学习手册(表的继承和分区)
- c语言 总结操作符使用 理解二进制存储
- 揭开Faiss的面纱 探究Facebook相似性搜索工具的原理
- etcdctl 使用说明
- Unity中一些优化方案
- 推荐一款任务调度的开源方案
- MySQL时间相关操作
- Kotlin与Android的奇妙之旅(一)
- Laravel 报错 CSRF not found的处理办法
- Jsp默认打开页面无数据访问Servlet获取数据
- 手把手教你如何玩转SSH(Spring+SpringMVC+Hibernate)
- Spread表格组件发布V1.1版本,支持最新SSJSON及Xamarin.iOS