如何做高清pdf下载网站,推荐几个好的网站,gooood设计网,设计师做私单网站一、etcd安装 https://github.com/etcd-io/etcd/releases 根据需要下载安装etcd, 确保添加到环境变量 执行 etcd -v 查看安装版本
二、etcd运行 本地运行集群 1.首先安装goreman
go install github.com/mattn/goremanlatest2.准备Procfile 将脚本下载到本地#xff0c;或者复…一、etcd安装 https://github.com/etcd-io/etcd/releases 根据需要下载安装etcd, 确保添加到环境变量 执行 etcd -v 查看安装版本
二、etcd运行 本地运行集群 1.首先安装goreman
go install github.com/mattn/goremanlatest2.准备Procfile 将脚本下载到本地或者复制下面脚本 https://github.com/etcd-io/etcd/blob/main/Procfile
# Use goreman to run go install github.com/mattn/goremanlatest
# 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 infra1http://127.0.0.1:12380,infra2http://127.0.0.1:22380,infra3http://127.0.0.1:32380 --initial-cluster-state new --enable-pprof --loggerzap --log-outputsstderr
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 infra1http://127.0.0.1:12380,infra2http://127.0.0.1:22380,infra3http://127.0.0.1:32380 --initial-cluster-state new --enable-pprof --loggerzap --log-outputsstderr
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 infra1http://127.0.0.1:12380,infra2http://127.0.0.1:22380,infra3http://127.0.0.1:32380 --initial-cluster-state new --enable-pprof --loggerzap --log-outputsstderr
#proxy: bin/etcd grpc-proxy start --endpoints127.0.0.1:2379,127.0.0.1:22379,127.0.0.1:32379 --listen-addr127.0.0.1:23790 --advertise-client-url127.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/goremanlatest# 1. Start the cluster using Procfile
# 2. Add learner node to the cluster
# % etcdctl member add infra4 --peer-urlshttp://127.0.0.1:42380 --learnertrue# 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 infra4http://127.0.0.1:42380,infra1http://127.0.0.1:12380,infra2http://127.0.0.1:22380,infra3http://127.0.0.1:32380 --initial-cluster-state existing --enable-pprof --loggerzap --log-outputsstderr# 4. The learner node can be promoted to voting member by the command
# % etcdctl member promote memberid
注意根据 etcd位置修改脚本 bin/etcd
执行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