etcd入门-(1)安装篇

一、etcd安装
https://github.com/etcd-io/etcd/releases
根据需要下载安装etcd, 确保添加到环境变量
执行 etcd -v 查看安装版本

二、etcd运行
本地运行集群
1.首先安装goreman

go install github.com/mattn/goreman@latest

2.准备Procfile
将脚本下载到本地,或者复制下面脚本
https://github.com/etcd-io/etcd/blob/main/Procfile

# Use goreman to run `go install github.com/mattn/goreman@latest`
# Change the path of bin/etcd if etcd is located elsewhereetcd1: bin/etcd --name infra1 --listen-client-urls http://127.0.0.1:2379 --advertise-client-urls http://127.0.0.1:2379 --listen-peer-urls http://127.0.0.1:12380 --initial-advertise-peer-urls http://127.0.0.1:12380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra1=http://127.0.0.1:12380,infra2=http://127.0.0.1:22380,infra3=http://127.0.0.1:32380' --initial-cluster-state new --enable-pprof --logger=zap --log-outputs=stderr
etcd2: bin/etcd --name infra2 --listen-client-urls http://127.0.0.1:22379 --advertise-client-urls http://127.0.0.1:22379 --listen-peer-urls http://127.0.0.1:22380 --initial-advertise-peer-urls http://127.0.0.1:22380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra1=http://127.0.0.1:12380,infra2=http://127.0.0.1:22380,infra3=http://127.0.0.1:32380' --initial-cluster-state new --enable-pprof --logger=zap --log-outputs=stderr
etcd3: bin/etcd --name infra3 --listen-client-urls http://127.0.0.1:32379 --advertise-client-urls http://127.0.0.1:32379 --listen-peer-urls http://127.0.0.1:32380 --initial-advertise-peer-urls http://127.0.0.1:32380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra1=http://127.0.0.1:12380,infra2=http://127.0.0.1:22380,infra3=http://127.0.0.1:32380' --initial-cluster-state new --enable-pprof --logger=zap --log-outputs=stderr
#proxy: bin/etcd grpc-proxy start --endpoints=127.0.0.1:2379,127.0.0.1:22379,127.0.0.1:32379 --listen-addr=127.0.0.1:23790 --advertise-client-url=127.0.0.1:23790 --enable-pprof# A learner node can be started using the below Procfile.learner (uncomment and run)# Use goreman to run `go install github.com/mattn/goreman@latest`# 1. Start the cluster using Procfile
# 2. Add learner node to the cluster
#   % etcdctl member add infra4 --peer-urls="http://127.0.0.1:42380" --learner=true# 3. Start learner node with goreman
# Change the path of bin/etcd if etcd is located elsewhere# uncomment below to setup# etcd4: bin/etcd --name infra4 --listen-client-urls http://127.0.0.1:42379 --advertise-client-urls http://127.0.0.1:42379 --listen-peer-urls http://127.0.0.1:42380 --initial-advertise-peer-urls http://127.0.0.1:42380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra4=http://127.0.0.1:42380,infra1=http://127.0.0.1:12380,infra2=http://127.0.0.1:22380,infra3=http://127.0.0.1:32380' --initial-cluster-state existing --enable-pprof --logger=zap --log-outputs=stderr# 4. The learner node can be promoted to voting member by the command
#   % etcdctl member promote <memberid>

注意根据 etcd位置修改脚本 bin/etcd

  1. 执行goreman start
➜  ~ goreman start
21:52:15 etcd1 | Starting etcd1 on port 5000
21:52:15 etcd2 | Starting etcd2 on port 5100
21:52:15 etcd3 | Starting etcd3 on port 5200

可以看到etcd已经运行起来了

测试一下数据

➜  ~ etcdctl put num   1
OK
➜  ~ etcdctl get num
num
1

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/717122.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

八. 实战:CUDA-BEVFusion部署分析-分析BEVFusion中各个ONNX

目录 前言0. 简述1. camera.backbone.onnx(fp16)2. camera.backbone.onnx(int8)3. camera.vtransform.onnx(fp16)4. fuser.onnx(fp16)5. fuser.onnx(int8)6. lidar.backbone.xyz.onnx7. head.bbox.onnx(fp16)总结下载链接参考 前言 自动驾驶之心推出的《CUDA与TensorRT部署实战…

每日一类:Qt中的万能容器

在Qt框架中&#xff0c;QVariant类扮演着一个非常重要的角色。它是一个万能容器类&#xff0c;可以存储Qt中的任何基本类型数据&#xff0c;包括自定义类型。这种灵活性使得QVariant成为Qt编程中不可或缺的工具&#xff0c;特别是在需要处理不同类型数据或进行对象间通信时。 …

Unity UGUI之Scrollbar基本了解

Unity的Scrollbar组件是用于在UI中创建滚动条的组件之一。滚动条通常与其他可滚动的UI元素&#xff08;如滚动视图或列表&#xff09;一起使用&#xff0c;以便用户可以在内容超出可见区域时滚动内容。 以下是Scrollbar的基本信息和用法: 1、创建 在Unity的Hierarchy视图中右…

柯西矩阵介绍

经典定义 柯西矩阵&#xff08;Cauchy Matrix&#xff09;&#xff0c;是一种特殊类型的矩阵&#xff0c;它在数学中的多个领域&#xff0c;包括线性代数、数值分析和插值理论中都有重要应用。柯西矩阵以19世纪法国数学家奥古斯丁-路易柯西的名字命名。 柯西矩阵是一个方阵&am…

Krylov matrix

Krylov矩阵是一种在数值线性代数中使用的矩阵&#xff0c;尤其是在迭代解法中用于求解线性方程组、特征值问题和其他线性代数问题。它是由俄国数学家阿列克谢尼古拉耶维奇克雷洛夫&#xff08;Alexei Nikolaevich Krylov&#xff09;的名字命名的。 Krylov子空间由以下形式的矩…

jetson nano——编译安装opencv==4.4

目录 1.下载源码&#xff0c;我提供的链接如下&#xff1a;1.1文件上传的路径位置&#xff0c;注意ymck是我自己的用户名&#xff08;你们自己换成你们自己相对应的就行&#xff09; 2.解压文件3.安装依赖4.增加swap交换内存4.1临时增加交换内存swap4.2永久增加swap 5.安装open…

2024-03-03 作业

作业要求&#xff1a; 1.使用fwrite、fread将一张随意的bmp图片&#xff0c;修改成德国的国旗 2.使用提供的getch函数&#xff0c;编写一个专门用来输入密码的函数&#xff0c;要求输入密码的时候&#xff0c;显示 * 号&#xff0c;输入回车的时候&#xff0c;密码输入结束 作业…

学习Android的第十九天

目录 Android ExpandableListView 分组列表 ExpandableListView 属性 ExpandableListView 事件 ExpandableListView 的 Adapter 范例 参考文档 Android ViewFlipper 翻转视图 ViewFlipper 属性 ViewFlipper 方法 为 ViewFlipper 加入 View 例子&#xff1a;全屏幕可…

【MySQL】索引(重点)-- 详解

一、索引 没有索引&#xff0c;可能会有什么问题&#xff1f; 索引 &#xff1a;提高数据库的性能&#xff0c;索引是物美价廉的东西了。不用加内存&#xff0c;不用改程序&#xff0c;不用调 sql &#xff0c;只要执行正确的 create index &#xff0c;查询速度就可能提高成…

加密与安全_探索数字证书

文章目录 Pre概述使用keytool生成证书使用Openssl生成证书 &#xff08;推荐&#xff09;证书的吊销小结 Pre PKI - 借助Nginx 实现Https 服务端单向认证、服务端客户端双向认证 PKI - 04 证书授权颁发机构&#xff08;CA&#xff09; & 数字证书 PKI - 数字签名与数字证…

java面试题(spring框架篇)(黑马 )

树形图&#xff1a; 一、Spring框架种的单例bean是线程安全吗&#xff1f; Service Scope("singleton") public class UserServiceImpl implements UserService{ } singleton:bean在每个Spring IOC容器中只有一个实例 protype&#xff1a;一个bean的定义可以有多个…

CPU iowait是什么意思

在linux系统&#xff0c;使用top命令时&#xff0c;可以看到cpu使用统计情况&#xff0c;有时我们会注意到iowait这一项非常高。我们直到&#xff0c;在cpu运行进程、线程时&#xff0c;遇到IO操作&#xff0c;因为IO读写通常比较慢&#xff0c;CPU通常可以阻塞线程&#xff0c…

【Web安全靶场】xss-labs-master 1-20

xss-labs-master 其他靶场见专栏 文章目录 xss-labs-masterlevel-1level-2level-3level-4level-5level-6level-7level-8level-9level-10level-11level-12level-13level-14level-15level-16level-17level-18level-19level-20 level-1 第一关没有进行任何限制&#xff0c;get请求…

pytorch_神经网络构建6

文章目录 强化学习概念实现qLearning基于这个思路,那么解决这个问题的代码如下 强化学习概念 强化学习有一个非常直观的表现&#xff0c;就是从出发点到目标之间存在着一个连续的状态转换&#xff0c;比如说从状态一到状态456&#xff0c;而每一个状态都有多种的行为&#xff…

全国青少年软件编程(Python)等级考试试卷(一级) 测试卷2021年12月

第 1 题 【 单选题 】 下面程序的运行结果是什么&#xff1f;&#xff08; &#xff09; a10 b5 ca*b print(c) A :10 B :15 C :50 D :5 正确答案:C 试题解析: 第 2 题 【 单选题 】 与a>b and b>c等价的是&#xff1f;&#xff08; &#xff09; A…

设计模式学习笔记 - 设计原则 - 1.单一职责原则

前言 前面我们提到过 SOLID 原则&#xff0c;实际上 SOLID 由 5 个设计原则组成&#xff0c;分别是&#xff1a;单一职责原则、开闭原则、里氏替换原则、接口隔离原则和依赖反转原则。它们分别对应 SLOID 中的 S、O、L、I、D 这 5 个英文字母。 今天来学习下 SOLID 原则中的第…

Libevent的使用及reactor模型

Libevent 是一个用C语言编写的、轻量级的开源高性能事件通知库&#xff0c;主要有以下几个亮点&#xff1a;事件驱动&#xff08; event-driven&#xff09;&#xff0c;高性能;轻量级&#xff0c;专注于网络&#xff0c;不如 ACE 那么臃肿庞大&#xff1b;源代码相当精炼、易读…

【Java】Java 中的方法引用写法

概述 方法引用&#xff08;MethodReference&#xff09;是Lambda表达式的另一种格式&#xff0c;在某些场景下可以提高代码的可读性 使用条件 只可以替换单方法的Lambda表达式 什么意思呢 &#xff1f; 例如下面这个Lambda表达式就不可以使用方法引用替换&#xff0c;因为…

100243. 将元素分配到两个数组中 I

说在前面 &#x1f388;不知道大家对于算法的学习是一个怎样的心态呢&#xff1f;为了面试还是因为兴趣&#xff1f;不管是出于什么原因&#xff0c;算法学习需要持续保持。 题目描述 给你一个下标从 1 开始、包含 不同 整数的数组 nums &#xff0c;数组长度为 n 。 你需要通…

C语言 快速排序——qsort函数的介绍

qsort函数 1. 函数介绍2. 函数使用2.1 整型排序2.2 字符排序2.3 字符串排序2.4 结构体排序 3. 用冒泡思想模拟qsort函数 我们以往使用冒泡排序和选择排序等对数据进行排序时&#xff0c;有可能会遇到搞不清排序次数&#xff0c;运行时间过长等一些问题&#xff0c;并且这些排序…