cpu
磁盘io

往主的写,同步给备

root@k8s-etcd02:~# cat  /etc/systemd/system/etcd.service 
[Unit]
Description=Etcd Server
After=network.target
After=network-online.target
Wants=network-online.target
Documentation=https://github.com/coreos

[Service]
Type=notify
WorkingDirectory=/var/lib/etcd
ExecStart=/usr/local/bin/etcd \
  --name=etcd-192.168.1.22 \
  --cert-file=/etc/kubernetes/ssl/etcd.pem \
  --key-file=/etc/kubernetes/ssl/etcd-key.pem \
  --peer-cert-file=/etc/kubernetes/ssl/etcd.pem \
  --peer-key-file=/etc/kubernetes/ssl/etcd-key.pem \
  --trusted-ca-file=/etc/kubernetes/ssl/ca.pem \
  --peer-trusted-ca-file=/etc/kubernetes/ssl/ca.pem \
  --initial-advertise-peer-urls=https://192.168.1.22:2380 \
  --listen-peer-urls=https://192.168.1.22:2380 \
  --listen-client-urls=https://192.168.1.22:2379,http://127.0.0.1:2379 \
  --advertise-client-urls=https://192.168.1.22:2379 \
  --initial-cluster-token=etcd-cluster-0 \
  --initial-cluster=etcd-192.168.1.21=https://192.168.1.21:2380,etcd-192.168.1.22=https://192.168.1.22:2380,etcd-192.168.1.23=https://192.168.1.23:2380 \
  --initial-cluster-state=new \
  --data-dir=/var/lib/etcd \
  --wal-dir= \
  --snapshot-count=50000 \
  --auto-compaction-retention=1 \
  --auto-compaction-mode=periodic \
  --max-request-bytes=10485760 \
  --quota-backend-bytes=8589934592
Restart=always
RestartSec=15
LimitNOFILE=65536
OOMScoreAdjust=-999

[Install]
WantedBy=multi-user.target

cpu
磁盘io

网络–》万M

监控etcd服务

root@k8s-etcd03:~# export NODE_IPS=“192.168.1.21 192.168.1.22 192.168.1.23”
root@k8s-etcd03:~# for ip in N O D E I P S ; d o E T C D C T L A P I = 3 / u s r / l o c a l / b i n / e t c d c t l − − e n d p o i n t s = h t t p s : / / {NODE_IPS}; do ETCDCTL_API=3 /usr/local/bin/etcdctl --endpoints=https:// NODEIPS;doETCDCTLAPI=3/usr/local/bin/etcdctlendpoints=https://{ip}:2379 --cacert=/etc/kubernetes/ssl/ca.pem --cert=/etc/kubernetes/ssl/etcd.pem --key=/etc/kubernetes/ssl/etcd-key.pem endpoint health; done
https://192.168.1.21:2379 is healthy: successfully committed proposal: took = 31.455832ms
https://192.168.1.22:2379 is healthy: successfully committed proposal: took = 21.7307ms
https://192.168.1.23:2379 is healthy: successfully committed proposal: took = 21.490284ms

备份

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐