ETCD集群搭建

    ETCD参数说明
    —data-dir 指定节点的数据存储目录,这些数据包括节点ID,集群ID,集群初始化配置,Snapshot文件,若未指定—wal-dir,还会存储WAL文件;
    —wal-dir 指定节点的was文件的存储目录,若指定了该参数,wal文件会和其他数据文件分开存储。
    —name 节点名称
    —initial-advertise-peer-urls 告知集群其他节点url.
    —listen-peer-urls 监听URL,用于与其他节点通讯
    —advertise-client-urls 告知客户端url, 也就是服务的url
    —initial-cluster-token 集群的ID
    —initial-cluster 集群中所有节点

/usr/bin/etcd -name etcd01 -initial-advertise-peer-urls http://192.168.50.12:2380 -listen-peer-urls http://192.168.50.12:2380 -listen-client-urls http://192.168.50.12:2379,http://127.0.0.1:2379 -advertise-client-urls http://192.168.50.12:2379 -initial-cluster-token etcd-cluster-1 -initial-cluster etcd01=http://192.168.50.12:2380,etcd02=http://192.168.50.13:2380,etcd03=http://192.168.50.16:2380 -initial-cluster-state new >> /var/log/etcd.log

/usr/bin/etcd -name etcd02 -initial-advertise-peer-urls http://192.168.50.13:2380 -listen-peer-urls http://192.168.50.13:2380 -listen-client-urls http://192.168.50.13:2379,http://127.0.0.1:2379 -advertise-client-urls http://192.168.50.13:2379 -initial-cluster-token etcd-cluster-1 -initial-cluster etcd01=http://192.168.50.12:2380,etcd02=http://192.168.50.13:2380,etcd03=http://192.168.50.16:2380 -initial-cluster-state new >> /var/log/etcd.log


/usr/bin/etcd -name etcd03 -initial-advertise-peer-urls http://192.168.50.16:2380 -listen-peer-urls http://192.168.50.16:2380 -listen-client-urls http://192.168.50.16:2379,http://127.0.0.1:2379 -advertise-client-urls http://192.168.50.16:2379 -initial-cluster-token etcd-cluster-1 -initial-cluster etcd01=http://192.168.50.12:2380,etcd02=http://192.168.50.13:2380,etcd03=http://192.168.50.16:2380 -initial-cluster-state new >> /var/log/etcd.log
 

你可能感兴趣的:(k8s)