12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- node1 10.0.0.50
- node2 10.0.0.51
- node3 10.0.0.52
- #[Member]
- ETCD_NAME="node1"
- ETCD_DATA_DIR="/var/lib/etcd"
- ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
- ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
- ETCD_HEARTBEAT_INTERVAL="1000"
- ETCD_ELECTION_TIMEOUT="5000"
- #[Clustering]
- ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.50:2380"
- ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.50:2379"
- ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380"
- ETCD_INITIAL_CLUSTER_TOKEN="frogofrock"
- ETCD_INITIAL_CLUSTER_STATE="new"
- напиши таску, которая заменит в файле /etc/default/etcd строку содержащую ETCD_INITIAL_CLUSTER= на ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380"
- и строку содержащую ETCD_INITIAL_CLUSTER_STATE= на ETCD_INITIAL_CLUSTER_STATE="new"
- systemctl start etcd.service; systemctl enable etcd.service
- etcdctl cluster-health
- etcdctl member list
- etcdctl member add node2 --peer-urls=http://10.0.0.51:2380
- #[Member]
- ETCD_NAME="node2"
- ETCD_DATA_DIR="/var/lib/etcd"
- ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
- ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
- ETCD_HEARTBEAT_INTERVAL="1000"
- ETCD_ELECTION_TIMEOUT="5000"
- #[Clustering]
- ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.51:2380"
- ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.51:2379"
- ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380,node2=http://10.0.0.51:2380"
- ETCD_INITIAL_CLUSTER_TOKEN="frogofrock"
- ETCD_INITIAL_CLUSTER_STATE="existing"
- #[Member]
- ETCD_NAME="node3"
- ETCD_DATA_DIR="/var/lib/etcd/"
- ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
- ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
- ETCD_HEARTBEAT_INTERVAL="1000"
- ETCD_ELECTION_TIMEOUT="5000"
- #[Clustering]
- ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.52:2380"
- ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.52:2379"
- ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380,node2=http://10.0.0.51:2380,node3=http://10.0.0.52:2380"
- ETCD_INITIAL_CLUSTER_TOKEN="frogofrock"
- ETCD_INITIAL_CLUSTER_STATE="existing"
- Пытаюсь настроить кластер etcd, после добавления второй ноды на лидере отказывается запускаться вторая нода. Конфигурация:
- #[Member]
- ETCD_NAME="node1"
- ETCD_DATA_DIR="/var/lib/etcd"
- ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
- ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
- ETCD_HEARTBEAT_INTERVAL="1000"
- ETCD_ELECTION_TIMEOUT="5000"
- #[Clustering]
- ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.50:2380"
- ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.50:2379"
- ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380"
- ETCD_INITIAL_CLUSTER_TOKEN="tst"
- ETCD_INITIAL_CLUSTER_STATE="new"
- #[Member]
- ETCD_NAME="node2"
- ETCD_DATA_DIR="/var/lib/etcd/"
- ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
- ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
- ETCD_HEARTBEAT_INTERVAL="1000"
- ETCD_ELECTION_TIMEOUT="5000"
- #[Clustering]
- ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.51:2380"
- ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.51:2379"
- ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380,node2=http://10.0.0.51:2380"
- ETCD_INITIAL_CLUSTER_TOKEN="tst"
- ETCD_INITIAL_CLUSTER_STATE="existing"
- etcdctl -w table endpoint --cluster status
|