windows系统下etcd的安装与使用

windows系统下etcd的安装与使用一 简介 etcd 是一个分布式一致性键值存储 其主要用于分布式系统的共享配置和服务发现 etcd 由 Go 语言编写二 下载并安装 1 下载地址 https github com coreos etcd releases2 将压缩文件解压到指定文件夹解压后的目录如下 其中 etcd exe 是服务端 etcdctl exe 是客户端二 简单实用 1 点击 etcd exe 运行 etcd

一、简介

  etcd是一个分布式一致性键值存储,其主要用于分布式系统的共享配置和服务发现。

  etcd由Go语言编写

二、下载并安装

  1.下载地址:

  Releases · etcd-io/etcd · GitHub

2. 将压缩文件解压到指定文件夹

 解压后的目录如下:

 windows系统下etcd的安装与使用

其中etcd.exe是服务端,etcdctl.exe是客户端

二、简单实用

1. 点击etcd.exe运行etcd服务

2. 客户端是有etcdctl来执行命令的

  1)帮助文档

  windows系统下etcd的安装与使用

  在安装目录命令提示符中执行 etcdctl help 可以查看etcdctl的基本命令如下:

NAME:    etcdctl - A simple command line client for etcd. USAGE:    etcdctl [global options] command [command options] [arguments...] VERSION:    3.3.8 COMMANDS:      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 GLOBAL OPTIONS:    --debug                          output cURL commands which can be used to reproduce the request    --no-sync                        don't synchronize cluster information before sending request    --output simple, -o simple       output response in the given format (simple, `extended` or `json`) (default: "simple")    --discovery-srv value, -D value  domain name to query for SRV records describing cluster endpoints    --insecure-discovery             accept insecure SRV records describing cluster endpoints    --peers value, -C value          DEPRECATED - "--endpoints" should be used instead    --endpoint value                 DEPRECATED - "--endpoints" should be used instead    --endpoints value                a comma-delimited list of machine addresses in the cluster (default: "http://127.0.0.1:2379,http://127.0.0.1:4001")    --cert-file value                identify HTTPS client using this SSL certificate file    --key-file value                 identify HTTPS client using this SSL key file    --ca-file value                  verify certificates of HTTPS-enabled servers using this CA bundle    --username value, -u value       provide username[:password] and prompt if password is not supplied.    --timeout value                  connection timeout per request (default: 2s)    --total-timeout value            timeout for the command execution (except watch) (default: 5s)    --help, -h                       show help    --version, -v                    print the version

2)查看版本号  etcdctl –version

  windows系统下etcd的安装与使用

3) 由于文档中建议API version的版本设为3

  设置版本set ETCDCTL_API=3

 windows系统下etcd的安装与使用

即可设置API version,设置成功后etcdctl help查看版本3和2命令和功能方面有不少的差别

3)通过put和get 存取值

 windows系统下etcd的安装与使用

存取key为hello,value为world

 windows系统下etcd的安装与使用

获取key为hello的值

常见的错误

当我们双击可执行文件出现闪退时说明etcd服务无法正常启动,此时我们可以通过在命令提示符中打开执行文件

1.端口被占用

windows系统下etcd的安装与使用

etcd默认使用2379,启动etcd服务时提示2379端口被占用,启动失败

windows系统下etcd的安装与使用

windows系统下etcd的安装与使用

我们看到有个虚拟机的程序占用了2379端口,此时我们可以kill掉占用改端口的程序(如果是不重要的程序可以kill掉的话),或者我们修改etcd服务启动监听的端口

etcd启动如果需要自定义参数的话,需要指定配置文件,并且配置文件的内容需要是json格式,我们创建etcd.conf文件,并且写入监听的端口配置   {“listen-client-urls”:”http://localhost:12379″}

我们可以通过指定配置文件启动etcd服务

> etcd.exe –config-file etcd.conf

windows系统下etcd的安装与使用

etcd服务启动正常

当我们自定义了etcd的服务监听端口时,使用etcdctl客户端工具时也需要通过–endpoints=127.0.0.1:12379 参数指定

windows系统下etcd的安装与使用

完美

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/198545.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月26日 下午2:58
下一篇 2026年3月26日 下午2:58


相关推荐

  • goland 2022 永久激活码_在线激活2022.03.13「建议收藏」

    (goland 2022 永久激活码)2021最新分享一个能用的的激活码出来,希望能帮到需要激活的朋友。目前这个是能用的,但是用的人多了之后也会失效,会不定时更新的,大家持续关注此网站~IntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,下面是详细链接哦~https://javaforall.net/100143.html…

    2022年4月2日
    3.0K
  • Jlink或者stlink用于SWD接口下载程序

    Jlink或者stlink用于SWD接口下载程序最近要使用stm32f103c8t6最小系统板,直接ISP串口下载程序太麻烦,就想着使用swd接口来调试。结果:通过SWD接口下载程序成功,但调试失败,还不知原因,会的的人麻烦交流一下。SWD接口:3.3VDIO(数据)CLK(时钟)GND1.首先声明jlink和stlink都有jtag和swd调试功能。jlink接口如下:如图,我使用的就是VCC…

    2022年4月25日
    55
  • Flash动画制作视频教程

    Flash动画制作视频教程Flash是由macromedia公司推出的交互式矢量图和Web动画的标准,由Adobe公司收购。做Flash动画的人被称之为闪客。网页设计者使用Flash创作出既漂亮又可改变尺寸的导航界面以及其他奇特的效果。Flash的前身是FutureWave公司的FutureSplash,是世界上第一个商用的二维矢量动画软件,用于设计和编辑Flash文档。1996年11月,美国Macromedi

    2022年6月1日
    31
  • ViewPager 详解(一)—基本入门

    ViewPager 详解(一)—基本入门前言:这两天研究研究ViewPager滚动功能,现在很多的app都有用到这个功能,我们的大虾米也有这个模块。要研究就彻底的研究研究,我从不满足于一个功能只是简单的应用,要学就学的彻底,所以我打算将ViewPager分几篇写,研究的哪个程度就写到哪个程度吧。今天是第一篇,基本入门篇。相关文章:1、《ViewPager详解(一)—基本入门》2、《ViewPager详…

    2022年7月22日
    15
  • 输入法个性化怎么设置_手机输入键盘怎么个性化设置

    输入法个性化怎么设置_手机输入键盘怎么个性化设置个性化设置技巧(补充输入法)子墨居士前言本次的内容大部分为推送。本打算自己推荐几款比较好用的桌面整理软件,然而最近事情越来越多,这部分的内容分享已经有很多不错的文章。就允许我偷一次懒呗(…

    2025年6月29日
    4
  • 小米割爱Kimi商标予月之暗面,意在图谋AI生态合纵连横

    小米割爱Kimi商标予月之暗面,意在图谋AI生态合纵连横

    2026年3月12日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号