etcd sh

【云原生K8s】二进制部署单master K8s+etcd集群 1、client 证书,服务端连接客户端时携带的证书,用于客户端验证服务端身份,如 kube-apiserver 访问 etcd;2、server 证书,客户端连接服务端时携带的证书,用于服务端验证客户端身份,如 etcd 对外提供服务;3、peer 证书,相互之间连接时使用的证书,如 etcd 节点之间进行验证和通信。这里全部都使用同一套证书认证。 阅读详情

etcdctl

etcdctl is a command line client for etcd.
It can be used in scripts or for administrators to explore an etcd cluster.

Getting etcdctl

The latest release is available as a binary at Github along with etcd.

etcdctl can also be built from source using the build script found in the parent directory.

Configuration

–debug

  • output cURL commands which can be used to reproduce the request

–no-sync

  • don’t synchronize cluster information before sending request
  • Use this to access non-published client endpoints
  • Without this flag, values from --endpoint flag will be overwritten by etcd cluster when it does internal sync.

–output, -o

  • output response in the given format (simple, extended or json)
  • default: "simple"

–discovery-srv, -D

  • domain name to query for SRV records describing cluster endpoints
  • default: none
  • env variable: ETCDCTL_DISCOVERY_SRV

–peers

  • a comma-delimited list of machine addresses in the cluster
  • default: "http://127.0.0.1:2379"
  • env variable: ETCDCTL_PEERS

–endpoint

  • a comma-delimited list of machine addresses in the cluster
  • default: "http://127.0.0.1:2379"
  • env variable: ETCDCTL_ENDPOINT
  • Without --no-sync flag, this will be overwritten by etcd cluster when it does internal sync.

–cert-file

  • identify HTTPS client using this SSL certificate file
  • default: none
  • env variable: ETCDCTL_CERT_FILE

–key-file

  • identify HTTPS client using this SSL key file
  • default: none
  • env variable: ETCDCTL_KEY_FILE

–ca-file

  • verify certificates of HTTPS-enabled servers using this CA bundle
  • default: none
  • env variable: ETCDCTL_CA_FILE

–username, -u

  • provide username[:password] and prompt if password is not supplied
  • default: none
  • env variable: ETCDCTL_USERNAME

–timeout

  • connection timeout per request
  • default: "1s"

–total-timeout

  • timeout for the command execution (except watch)
  • default: "5s"

Usage

Setting Key Values

Set a value on the /foo/bar key:

$ etcdctl set /foo/bar "Hello world"
Hello world

Set a value on the /foo/bar key with a value that expires in 60 seconds:

$ etcdctl set /foo/bar "Hello world" --ttl 60
Hello world

Conditionally set a value on /foo/bar if the previous value was “Hello world”:

$ etcdctl set /foo/bar "Goodbye world" --swap-with-value "Hello world"
Goodbye world

Conditionally set a value on /foo/bar if the previous etcd index was 12:

$ etcdctl set /foo/bar "Goodbye world" --swap-with-index 12
Goodbye world

Create a new key /foo/bar, only if the key did not previously exist:

$ etcdctl mk /foo/new_bar "Hello world"
Hello world

Create a new in-order key under dir /fooDir:

$ etcdctl mk --in-order /fooDir "Hello world"

Create a new dir /fooDir, only if the key did not previously exist:

$ etcdctl mkdir /fooDir

Update an existing key /foo/bar, only if the key already existed:

$ etcdctl update /foo/bar "Hola mundo"
Hola mundo

Create or update a directory called /mydir:

$ etcdctl setdir /mydir

Retrieving a key value

Get the current value for a single key in the local etcd node:

$ etcdctl get /foo/bar
Hello world

Get the value of a key with additional metadata in a parseable format:

$ etcdctl -o extended get /foo/bar
Key: /foo/bar
Modified-Index: 72
TTL: 0
Etcd-Index: 72
Raft-Index: 5611
Raft-Term: 1

Hello World

Listing a directory

Explore the keyspace using the ls command

$ etcdctl ls
/akey
/adir
$ etcdctl ls /adir
/adir/key1
/adir/key2

Add --recursive to recursively list subdirectories encountered.

$ etcdctl ls --recursive
/akey
/adir
/adir/key1
/adir/key2

Directories can also have a trailing / added to output using -p.

$ etcdctl ls -p
/akey
/adir/

Deleting a key

Delete a key:

$ etcdctl rm /foo/bar

Delete an empty directory or a key-value pair

$ etcdctl rmdir /path/to/dir

or

$ etcdctl rm /path/to/dir --dir

Recursively delete a key and all child keys:

$ etcdctl rm /path/to/dir --recursive

Conditionally delete /foo/bar if the previous value was “Hello world”:

$ etcdctl rm /foo/bar --with-value "Hello world"

Conditionally delete /foo/bar if the previous etcd index was 12:

$ etcdctl rm /foo/bar --with-index 12

Watching for changes

Watch for only the next change on a key:

$ etcdctl watch /foo/bar
Hello world

Continuously watch a key:

$ etcdctl watch /foo/bar --forever
Hello world
.... client hangs forever until ctrl+C printing values as key change

Continuously watch a key, starting with a given etcd index:

$ etcdctl watch /foo/bar --forever --index 12
Hello world
.... client hangs forever until ctrl+C printing values as key change

Continuously watch a key and exec a program:

$ etcdctl exec-watch /foo/bar -- sh -c "env | grep ETCD"
ETCD_WATCH_ACTION=set
ETCD_WATCH_VALUE=My configuration stuff
ETCD_WATCH_MODIFIED_INDEX=1999
ETCD_WATCH_KEY=/foo/bar
ETCD_WATCH_ACTION=set
ETCD_WATCH_VALUE=My new configuration stuff
ETCD_WATCH_MODIFIED_INDEX=2000
ETCD_WATCH_KEY=/foo/bar

Continuously and recursively watch a key and exec a program:

$ etcdctl exec-watch --recursive /foo -- sh -c "env | grep ETCD"
ETCD_WATCH_ACTION=set
ETCD_WATCH_VALUE=My configuration stuff
ETCD_WATCH_MODIFIED_INDEX=1999
ETCD_WATCH_KEY=/foo/bar
ETCD_WATCH_ACTION=set
ETCD_WATCH_VALUE=My new configuration stuff
ETCD_WATCH_MODIFIED_INDEX=2000
ETCD_WATCH_KEY=/foo/barbar

Return Codes

The following exit codes can be returned from etcdctl:

0    Success
1    Malformed etcdctl arguments
2    Failed to connect to host
3    Failed to auth (client cert rejected, ca validation failure, etc)
4    400 error from etcd
5    500 error from etcd

Endpoint

If the etcd cluster isn’t available on http://127.0.0.1:2379, specify a --endpoint flag or ETCDCTL_ENDPOINT environment variable. One endpoint or a comma-separated list of endpoints can be listed. This option is ignored if the --discovery-srv option is provided.

ETCDCTL_ENDPOINT="http://10.0.28.1:4002" etcdctl set my-key to-a-value
ETCDCTL_ENDPOINT="http://10.0.28.1:4002,http://10.0.28.2:4002,http://10.0.28.3:4002" etcdctl set my-key to-a-value
etcdctl --endpoint http://10.0.28.1:4002 my-key to-a-value
etcdctl --endpoint http://10.0.28.1:4002,http://10.0.28.2:4002,http://10.0.28.3:4002 etcdctl set my-key to-a-value

Username and Password

If the etcd cluster is protected by authentication, specify username and password using the --username or ETCDCTL_USERNAME environment variable. When --username flag or ETCDCTL_USERNAME environment variable doesn’t contain password, etcdctl will prompt password in interactive mode.

ETCDCTL_USERNAME="root:password" etcdctl set my-key to-a-value

DNS Discovery

To discover the etcd cluster through domain SRV records, specify a --discovery-srv flag or ETCDCTL_DISCOVERY_SRV environment variable. This option takes precedence over the --endpoint flag.

ETCDCTL_DISCOVERY_SRV="some-domain" etcdctl set my-key to-a-value
etcdctl --discovery-srv some-domain set my-key to-a-value

Project Details

Versioning

etcdctl uses semantic versioning.
Releases will follow lockstep with the etcd release cycle.

License

etcdctl is under the Apache 2.0 license. See the LICENSE file for details.

保姆级教程:手把手教你用Killer.sh模拟考环境,高效备战CKA认证 本文提供了一份详细的Killer.sh模拟考环境使用指南,帮助考生高效备战CKA认证。通过解析模拟环境架构、36小时黄金时间分配策略、高频难题解题框架以及错题分类与补救策略,全面提升考生的Kubernetes管理员技能和应试能力。 阅读详情

相关推荐

Docker部署Milvus时,利用官方脚本standalone_embed.sh自动安装etcd和 minio。

仅包含 Milvus 的核心组件(如 QueryNode, DataNode, RootCoord 等)。镜像中打包 etcd 和 minio 的二进制文件并配置为通过环境变量自动启动。Docker 的最佳实践是“一个容器一个进程”。Milvus 采用微服务架构。官方 Docker 镜像。脚本看起来像是一键启动,但它实际上是生成了。,而不是在一个容器内运行所有服务。Milvus 提供的。

inlooke的专栏 200

etcdctl --help

NAME:   etcdctl - A simple command line client for etcd.USAGE:   etcdctl [global options] command [command options] [arguments...]VERSION:   2.1.2COMMANDS:   backup        backup an etcd directory   c...

weixin_34055787的博客 203

《UE4游戏开发》之 《音效系统的实现》

音效系统需要负责管理什么事情: 1.1 确定声音控制的分类:如背景音乐、技能音效、界面音效、角色配音等,不同游戏对声音有不同的分类 1.2 控制每个分类的声音的开启与关闭,以及调节每个分类声音的大小 解决如何分类: 2.1 首先需要知道ue4为声音分类提供了什么:SoundClass通常需要一个根分类【SC_RPG_Master】,便于总体控制音效,以及指定引擎默认启动的音效 打开SoundClass资产【SC_RPG_Master】,对根控制的设置,将逐级传递并按比例进行设置,以此达到控制一类声音的目的.

qq_21919621的博客 2126

OpenEuler 部署 kubesphere 遇到问题及处理

安装后, 发现很简单, 遇到的唯一问题就是config-sample.yaml文件的主机一栏,我写重复了,导致安装报错, 脚本找不到。唯一的问题就是在配置文件里我已经打开相关组件的安装了,但是都没有安装。换掉Centos 使用OpenEuler 版本 22.09。应该是我使用的命令不对吧?安装kubesphere 一开始还挺担心的。创建配置,然后使用配置文件创建集群。

gs80140的专栏 2612

cartographer基于3d地图的纯定位模式

关于纯定位模式呢,本人试过2d和3d,怎么说呢,有条件的话,建议直接上3d,因为博主当初在做定位时针对室内和室外都尝试过,2d只在室内环境下效果会很棒,但是在室外就呵呵啦!所以这里直接讲解3d室外定位(建图篇请自己查看我之前的博客:[3d建图](https://blog.csdn.net/qq_40216084/article/details/105531983) 看了我之前的博客大概知道配置文件和源文件路径了,我这里就不把路径写出来了,挺麻烦的。直接讲怎么做把,有不懂的留言,看到了我一定知无不言。 **首

qq_40216084的博客 5552

PPT+视频 | 详解智能营销增益模型(uplift model)

分享营销增益模型的原理和常见的建模及评估方法,并以淘票票智能票补为例介绍uplift model技术的实践经验。

阿里文娱技术 8626

redisson Command execution timeout for command: (SENTINEL SENTINELS), params: [xxx]

切换客户端至3.11.6版本,官方库的issue里有提到升级至3.15.0同样可以解决问题,但是我实测并不可以,或许是我本身配置的原因,总之3.13-3.15版本之内的人可参考此举措解决此问题。

weixin_41156012的博客 4877

Howland电流源电路:从理论到实践的深度解析与优化策略

本文深度解析了Howland电流源电路的工作原理,从经典四电阻架构的“虚短”“虚断”分析,到其实现宽带恒流输出的理论优势。重点剖析了实践中因电阻精度、运放参数及PCB布局导致的性能瓶颈,并提供了引入第五电阻、优化运放选型等关键优化策略,旨在将输出阻抗从kΩ级提升至MΩ级,以满足精密测量与传感器驱动等应用需求。

weixin_29243063的博客 441

Redisson : Command execution timeout for command: (PING)报错解决

Command execution timeout for command: (PING)

qq_40343117的博客 2万+

GIS常用符号化色带(超级色带)根据python制作

GIS自带的色带比较单一,今天分享一款色带,应用之后大家出图的时候可以选择更多的配色,符号化/点击色块/样式引用/将样式添加至列表即可。色带类型比较多,大家可以自己尝试下不同的风格。简单符号化一下,看看效果。以中国县级行政区划为例,

J_Giser的博客 2636

C# WinForms 多语种切换实现:打造国际化应用程序

合理实现多语种切换功能可以显著提升应用程序的国际化水平。模块化设计:将本地化逻辑模块化,便于管理和维护。异常处理:始终捕获和处理可能的异常,确保程序的健壮性。资源管理:合理管理资源文件,避免重复和遗漏。测试:在不同语言环境下进行全面测试,确保所有字符串都能正确显示。文档和注释:为关键代码添加详细的文档和注释,便于后续维护。

墨夶的博客 1690

kubesphere 单节点启动 etcd 报错

kubekey安装 ./kk create cluster -f config-sample.yaml --with-local-storage 时报错。检查etcd日志 journalctl -xeu etcd 发现如下报错。修改如下: 配置文件。

gs80140的专栏 1082

Oracle EBS 中美国销售税的实现方式

Oracle EBS通过eBTax引擎实现美国销售税管理,需配置税务管辖区、税率及规则等要素,基于收货地址和商品分类计税。系统支持免税交易和使用税处理,但因美国税率复杂多变,建议集成Vertex等第三方服务自动更新税率。关键配置包括创建USSales Tax制度、维护地点层级及物料税务分类,同时需管理客户免税证书。对于跨国业务,系统也支持欧盟VAT等其他国家税制配置。

金牌架构师 295

test-definitions/blob/master/auto-test/etcd/etcd.sh

#!/bin/bash #回显执行的命令和参数 set -x #cd到目录执行脚本,然后通过cd - 返回到当前目录 cd ../../utils . ./sys_info.sh . ./sh-test-lib cd - #根据不同的发行版安装repo case "${distro}" in centos|fedora) sudo wget -O /etc/yum.repos.d/est

jason的笔记 468

精度与速度双突破:YOLOv8-Pose 在 RK3588 上实现高性能人体姿态分析部署

本教程从YOLOv8-pose模型的姿态识别训练,到RK3588的边缘量化部署,为你打造了一套“高精度+高实时性+低成本”的人体姿态分析解决方案。无论是健身动作纠正、智能安防行为检测,还是工业人员姿态监控,这套技术都能直接复用——你只需替换数据集与业务逻辑,即可快速落地专属的边缘AI姿态识别系统。如果你在实践中遇到任何卡点,欢迎随时交流。记住,人体姿态识别的价值在于“关键点准、推理快、部署易”,而这三者的平衡,正是你通过本教程能掌握的核心能力。

know_F0727的博客 434

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

Kubernetes外置Etcd数据恢复

#安装kubernetes Kubernetes我用的安装包1.12.0,见 https://sealyun.com/pro/products/ 安装master只需要两步 sh init.sh sh master.sh 最近重装是因为遇到了Kubernetes证书只有1年有效的坑,可以重新生成证书,可是新证书也只有1年,每年做一次太不好了,所以按照https://blog.51cto.com...

ooyyaa6561的博客 494

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

etcd c++ 使用_使用Statefulset在k8s集群中部署etcd集群

前言我通过自己构建dockerfile定制自己的镜像。按照我的步骤,前期将启动脚本和etcd所需配置导入镜像中,这样一来后期部署的yaml只需要打入几个环境变量即可,这样将非常简洁方便!所需脚本和所有内容都将在我的GitHub中找到:https://github.com/xll-forever/k8s-etcd​github.com当然,etcd安装包可以去官网下载压缩包,解压后与Dockerfi...

weixin_42539973的博客 308

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

别只刷题了!用Killer.sh和KodeKloud高效搭建你的CKA模拟实战环境

本文介绍了如何利用Killer.sh和KodeKloud高效搭建CKA模拟实战环境,帮助考生通过实战训练提升备考效率。文章详细解析了36小时冲刺法则、本地多集群实验室配置方案以及KodeKloud的精准训练法,助力考生在CKA认证考试中取得优异成绩。

weixin_30920597的博客 296

ETCD 配额/空间告警模拟方案

是一款用于模拟 ETCD 数据库高使用率、触发NOSPACE空间告警等场景的测试脚本。

Johnny's Lab 742

etcd 指定配置文件启动_5步完成 etcd 单机集群部署

一、下载 etcd这里以 ubuntu x64 举例:wget https://github.com/etcd-io/etcd/releases/download/v3.4.0-rc.3/etcd-v3.4.0-rc.3-linux-amd64.tar.gz二、创建如下目录结构三、新增三个配置文件etcd1/etcd.conf 配置文件:name: etcd-1data-dir: /home/xm...

weixin_42143221的博客 1239

etcd两种本地集群简单部署方式

在当前随机目录创建文件Procfile,其他文件名应该也可。测试集群是否没问题可以按照官网的流程进行尝试。检查goreman是否安装成功。

weixin_63023132的博客 584

二进制部署k8集群(上)搭建单机matser和etcd集群

启动聚合层相关配置:–requestheader-client-ca-file,–proxy-client-cert-file,–proxy-client-key-file,–requestheader-allowed-names,–requestheader-extra-headers-prefix,–requestheader-group-headers,–requestheader-username-headers,–enable-aggregator-routing。

weixin_42054864的博客 337

docker启动带etcd集群命名

cat dockeretcd.sh #!/bin/sh dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --cluster-store=etcd://master:2379 --cluster-advertise=master:2375&

tonysh_zds的博客 392

etcd-server-8-12: ERROR (spawn error)

我的是这里出问题了 vi /etc/supervisord.d/etcd-server.ini #这是错误的 [program:etcd-server-7-12] command=/opt/etcd/etcd-server-startup.sh ; the program (relative uses PATH, can take args) numprocs=1 ; number of p

送个祝福给小豪的博客 404

记 etcd 无法在docker-compose.yml启动后无法映射数据库目录的问题

1、将etcd 单独提取 Dockerfile,指定配置文件和数据目录。2、同目录下写配置文件 etcd.yaml。4、同级目录下启动startetcd.sh。3、写启动脚本startetcd.sh。

qq_40934195的博客 510

ETCD官网文档系列(三)

Install 安装预编译二进制文件 安装etcd最简单的方法是从预构建的二进制文件: Download the compressed archive file for your platform from Releases, choosing release v3.5.0 or later. Unpack the archive file. This results in a directory containing the binaries. Add the executable binaries t

paopaohll的博客 533
上一篇: test chan
下一篇: hyperledger-fabric v2.2 环境搭建
go_sparrow
博客等级 码龄11年 25粉丝 257原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值