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个节点启动完成

  • 相关阅读:
    ASP.NET大闲话:ashx文件有啥用
    Silverlight之我见——制作星星闪烁动画
    今天写了一个简单的新浪新闻RSS操作类库
    继续聊WPF——设置网格控件列标题的样式
    继续聊WPF——如何获取ListView中选中的项
    继续聊WPF——Thumb控件
    继续聊WPF——进度条
    继续聊WPF——自定义CheckBox控件外观
    继续聊WPF——Expander控件(1)
    继续聊WPF——Expander控件(2)
  • 原文地址:https://www.cnblogs.com/luckygxf/p/8698498.html
Copyright © 2011-2022 走看看