Saturday, October 14, 2017

etcd cluster setting

ETCDClusterSetting

ETCD Cluster Setting

Config File

ETCD_DATA_DIR=/opt/etcd
ETCD_NAME=master
ETCD_INITIAL_CLUSTER=master=http://172.16.101.71:2380,master02=http://172.16.101.72:2380,master03=http://172.16.101.73:2380
ETCD_LISTEN_PEER_URLS=http://172.16.101.71:2380
ETCD_INITIAL_ADVERTISE_PEER_URLS=http://172.16.101.71:2380
ETCD_ADVERTISE_CLIENT_URLS=http://172.16.101.71:2379
ETCD_LISTEN_CLIENT_URLS=http://172.16.101.71:2379,http://127.0.0.1:4001, http://172.16.101.71:4001, http://127.0.0.1:2379
ETCD_INITIAL_CLUSTER_STATE=new
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
ETCD_LOG_OUTPUT=stdout
GOMAXPROCS=8
[Unit]
Description=Etcd Server
Documentation=https://github.com/coreos/etcd
After=network.target
Before=flanneld.service

[Service]
User=root
Type=simple
EnvironmentFile=-/opt/config/etcd.conf
ExecStart=/opt/bin/etcd
Restart=on-failure
RestartSec=10s
LimitNOFILE=40000

[Install]
WantedBy=multi-user.target

Testing

deployer@k8s-master01:~$ sudo /opt/bin/etcdctl member list
[sudo] password for deployer:
a33460d93e5a3bc: name=master03 peerURLs=http://172.16.101.73:2380 clientURLs=http://172.16.101.73:2379 isLeader=true
5dbe67c8f4804006: name=master02 peerURLs=http://172.16.101.72:2380 clientURLs=http://172.16.101.72:2379 isLeader=false
ae3548c613d49701: name=master peerURLs=http://172.16.101.71:2380 clientURLs=http://172.16.101.71:2379 isLeader=false

1 comment:

  1. I like this website very much, Its a really nice post to read and obtain information.

    ReplyDelete