zoukankan      html  css  js  c++  java
  • etcd单机集群

    etcd在单机部署集群,可以先弄清楚配置文件参数的意思。起3个集成监听不同的端口号

    1. 启动

    在/etc/soft/etcd/node1文件夹中,创建脚本start1.sh

    etcd --name infra1 --initial-advertise-peer-urls http://127.0.0.1:2381 
      --listen-peer-urls http://127.0.0.1:2381 
        --listen-client-urls http://127.0.0.1:2379 
              --advertise-client-urls http://127.0.0.1:2379 
                --initial-cluster-token etcd-cluster-1 
                      --initial-cluster infra1=http://127.0.0.1:2381,infra2=http://127.0.0.1:2382,infra3=http://127.0.0.1:2383 
                        --initial-cluster-state new

    在/etc/soft/etcd/node2文件夹中,创建脚本start2.sh

    etcd --name infra2 --initial-advertise-peer-urls http://127.0.0.1:2382 
      --listen-peer-urls http://127.0.0.1:2382 
        --listen-client-urls http://127.0.0.1:2378 
              --advertise-client-urls http://127.0.0.1:2378 
                --initial-cluster-token etcd-cluster-1 
                      --initial-cluster infra1=http://127.0.0.1:2381,infra2=http://127.0.0.1:2382,infra3=http://127.0.0.1:2383 
                        --initial-cluster-state new

    在/etc/soft/etcd/node3文件夹中,创建脚本start3.sh

    etcd --name infra3 --initial-advertise-peer-urls http://127.0.0.1:2383 
      --listen-peer-urls http://127.0.0.1:2383 
        --listen-client-urls http://127.0.0.1:2377 
              --advertise-client-urls http://127.0.0.1:2377 
                --initial-cluster-token etcd-cluster-1 
                      --initial-cluster infra1=http://127.0.0.1:2381,infra2=http://127.0.0.1:2382,infra3=http://127.0.0.1:2383 
                        --initial-cluster-state new

    分别运行三个脚本

    2. 检查集群是否启动成功

    etcdctl --endpoint "http://127.0.0.1:2379" member list
    19ac17627e3e396f: name=infra2 peerURLs=http://127.0.0.1:2382 clientURLs=http://127.0.0.1:2378 isLeader=false
    8f65a5fdd9ee42ad: name=infra3 peerURLs=http://127.0.0.1:2383 clientURLs=http://127.0.0.1:2377 isLeader=true
    e7b968b9fb1bc003: name=infra1 peerURLs=http://127.0.0.1:2381 clientURLs=http://127.0.0.1:2379 isLeader=false
    etcdctl cluster-health
    member 19ac17627e3e396f is healthy: got healthy result from http://127.0.0.1:2378
    member 8f65a5fdd9ee42ad is healthy: got healthy result from http://127.0.0.1:2377
    member e7b968b9fb1bc003 is healthy: got healthy result from http://127.0.0.1:2379

    3个节点启动完成

  • 相关阅读:
    UOJ #455 [UER #8]雪灾与外卖 (贪心、模拟费用流)
    Codeforces 482E ELCA (LCT)
    Codeforces 798D Mike and distribution (构造)
    AtCoder AGC017C Snuke and Spells
    HDU 6089 Rikka with Terrorist (线段树)
    HDU 6136 Death Podracing (堆)
    AtCoder AGC032D Rotation Sort (DP)
    jenkins+python+kubectl实现批量更新k8s镜像
    Linux 下载最新kubectl版本的命令:
    jenkins X 和k8s CI/CD
  • 原文地址:https://www.cnblogs.com/luckygxf/p/8698498.html
Copyright © 2011-2022 走看看