add third node
This commit is contained in:
26
README.md
26
README.md
@@ -82,6 +82,7 @@ vim req-csr.json:
|
|||||||
"hosts": [
|
"hosts": [
|
||||||
"3.14.3.102",
|
"3.14.3.102",
|
||||||
"3.14.3.107",
|
"3.14.3.107",
|
||||||
|
"3.14.3.103",
|
||||||
"127.0.0.1"
|
"127.0.0.1"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
@@ -196,12 +197,25 @@ etcd --name purple --initial-advertise-peer-urls https://3.14.3.107:2380 \
|
|||||||
--listen-client-urls https://3.14.3.107:2379,https://127.0.0.1:2379 \
|
--listen-client-urls https://3.14.3.107:2379,https://127.0.0.1:2379 \
|
||||||
--advertise-client-urls https://3.14.3.107:2379 \
|
--advertise-client-urls https://3.14.3.107:2379 \
|
||||||
--initial-cluster-token pi-cluster-1 \
|
--initial-cluster-token pi-cluster-1 \
|
||||||
--initial-cluster red=https://3.14.3.102:2380,purple=https://3.14.3.107:2380 \
|
--initial-cluster red=https://3.14.3.102:2380,purple=https://3.14.3.107:2380,grey=https://3.14.3.103:2380 \
|
||||||
--initial-cluster-state new \
|
--initial-cluster-state new \
|
||||||
--client-cert-auth --trusted-ca-file=/certs/ca.pem \
|
--client-cert-auth --trusted-ca-file=/certs/ca.pem \
|
||||||
--cert-file=/certs/client.pem --key-file=/certs/client-key.pem \
|
--cert-file=/certs/client.pem --key-file=/certs/client-key.pem \
|
||||||
--peer-client-cert-auth --peer-trusted-ca-file=/certs/ca.pem \
|
--peer-client-cert-auth --peer-trusted-ca-file=/certs/ca.pem \
|
||||||
--peer-cert-file=/certs/purple.pem --peer-key-file=/certs/purple-key.pem
|
--peer-cert-file=/certs/purple.pem --peer-key-file=/certs/purple-key.pem
|
||||||
|
|
||||||
|
export ETCD_UNSUPPORTED_ARCH=arm64
|
||||||
|
etcd --name grey --initial-advertise-peer-urls https://3.14.3.103:2380 \
|
||||||
|
--listen-peer-urls https://3.14.3.103:2380 \
|
||||||
|
--listen-client-urls https://3.14.3.103:2379,https://127.0.0.1:2379 \
|
||||||
|
--advertise-client-urls https://3.14.3.103:2379 \
|
||||||
|
--initial-cluster-token pi-cluster-1 \
|
||||||
|
--initial-cluster red=https://3.14.3.102:2380,purple=https://3.14.3.107:2380,grey=https://3.14.3.103:2380 \
|
||||||
|
--initial-cluster-state new \
|
||||||
|
--client-cert-auth --trusted-ca-file=/certs/ca.pem \
|
||||||
|
--cert-file=/certs/client.pem --key-file=/certs/client-key.pem \
|
||||||
|
--peer-client-cert-auth --peer-trusted-ca-file=/certs/ca.pem \
|
||||||
|
--peer-cert-file=/certs/grey.pem --peer-key-file=/certs/grey-key.pem
|
||||||
```
|
```
|
||||||
|
|
||||||
## Systemd
|
## Systemd
|
||||||
@@ -218,10 +232,10 @@ Type=notify
|
|||||||
Environment=ETCD_UNSUPPORTED_ARCH=arm64
|
Environment=ETCD_UNSUPPORTED_ARCH=arm64
|
||||||
Environment=ETCD_DATA_DIR=/var/lib/etcd
|
Environment=ETCD_DATA_DIR=/var/lib/etcd
|
||||||
Environment=ETCD_NAME=red
|
Environment=ETCD_NAME=red
|
||||||
Environment=ETCD_INITIAL_ADVERTISE_PEER_URLS=https://3.14.3.102:2380
|
Environment=ETCD_INITIAL_ADVERTISE_PEER_URLS=https://$IP:2380
|
||||||
Environment=ETCD_LISTEN_PEER_URLS=https://3.14.3.102:2380
|
Environment=ETCD_LISTEN_PEER_URLS=https://$IP:2380
|
||||||
Environment=ETCD_LISTEN_CLIENT_URLS=https://3.14.3.102:2379,https://127.0.0.1:2379
|
Environment=ETCD_LISTEN_CLIENT_URLS=https://$IP,https://127.0.0.1:2379
|
||||||
Environment=ETCD_ADVERTISE_CLIENT_URLS=https://3.14.3.102:2379
|
Environment=ETCD_ADVERTISE_CLIENT_URLS=https://$IP:2379
|
||||||
Environment=ETCD_INITIAL_CLUSTER_TOKEN=pi-cluster-1
|
Environment=ETCD_INITIAL_CLUSTER_TOKEN=pi-cluster-1
|
||||||
Environment=ETCD_INITIAL_CLUSTER="red=https://3.14.3.102:2380,purple=https://3.14.3.107:2380,grey=https://3.14.3.103:2380"
|
Environment=ETCD_INITIAL_CLUSTER="red=https://3.14.3.102:2380,purple=https://3.14.3.107:2380,grey=https://3.14.3.103:2380"
|
||||||
Environment=ETCD_INITIAL_CLUSTER_STATE=new
|
Environment=ETCD_INITIAL_CLUSTER_STATE=new
|
||||||
@@ -254,7 +268,7 @@ export ETCDCTL_DIAL_TIMEOUT=3s;
|
|||||||
export ETCDCTL_CACERT=./certs/ca.pem; # ca.pem
|
export ETCDCTL_CACERT=./certs/ca.pem; # ca.pem
|
||||||
export ETCDCTL_CERT=./certs/client.pem; # 3.14.3.102.pem
|
export ETCDCTL_CERT=./certs/client.pem; # 3.14.3.102.pem
|
||||||
export ETCDCTL_KEY=./certs/client-key.pem; # 3.14.3.102-key.pem
|
export ETCDCTL_KEY=./certs/client-key.pem; # 3.14.3.102-key.pem
|
||||||
export ETCDCTL_ENDPOINTS=https://3.14.3.102:2379,https://3.14.3.107:2379,https://3.14.3.103;
|
export ETCDCTL_ENDPOINTS=https://3.14.3.102:2379,https://3.14.3.107:2379,https://3.14.3.103:2379;
|
||||||
etcdctl put foo bar
|
etcdctl put foo bar
|
||||||
etcdctl get foo
|
etcdctl get foo
|
||||||
while true; do etcdctl get foo && sleep 1; done;
|
while true; do etcdctl get foo && sleep 1; done;
|
||||||
|
|||||||
Reference in New Issue
Block a user