• 安装部署
  • 原先etcd单机,扩容3etcd ,2master 。etcd报错

ARN[12:15:00 CST] Task failed …
WARN[12:15:00 CST] error: Failed to start etcd cluster: Failed to exec command: sudo -E /bin/sh -c “export ETCDCTL_API=2;export ETCDCTL_CERT_FILE=‘/etc/ssl/etcd/ssl/admin-node2.pem’;export ETCDCTL_KEY_FILE=‘/etc/ssl/etcd/ssl/admin-node2-key.pem’;export ETCDCTL_CA_FILE=‘/etc/ssl/etcd/ssl/ca.pem’;/usr/local/bin/etcdctl –endpoints=https://192.168.1.113:2379,https://192.168.1.114:2379,https://192.168.1.166:2379 cluster-health | grep -q ‘cluster is healthy’”
: Process exited with status 1
Error: Failed to start etcd cluster: Failed to start etcd cluster: Failed to exec command: sudo -E /bin/sh -c “export ETCDCTL_API=2;export ETCDCTL_CERT_FILE=‘/etc/ssl/etcd/ssl/admin-node2.pem’;export ETCDCTL_KEY_FILE=‘/etc/ssl/etcd/ssl/admin-node2-key.pem’;export ETCDCTL_CA_FILE=‘/etc/ssl/etcd/ssl/ca.pem’;/usr/local/bin/etcdctl –endpoints=https://192.168.1.113:2379,https://192.168.1.114:2379,https://192.168.1.166:2379 cluster-health | grep -q ‘cluster is healthy’”
: Process exited with status 1
Usage:
kk add nodes [flags]

Flags:
–download-cmd string The user defined command to download the necessary binary files. The first param ‘%s’ is output path, the second param ‘%s’, is the URL (default “curl -L -o %s %s”)
-f, –filename string Path to a configuration file
-h, –help help for nodes
–skip-pull-images Skip pre pull images
-y, –yes Skip pre-check of the installation

Global Flags:
–debug Print detailed information (default true)
–in-cluster Running inside the cluster

Failed to start etcd cluster: Failed to start etcd cluster: Failed to exec command: sudo -E /bin/sh -c “export ETCDCTL_API=2;export ETCDCTL_CERT_FILE=‘/etc/ssl/etcd/ssl/admin-node2.pem’;export ETCDCTL_KEY_FILE=‘/etc/ssl/etcd/ssl/admin-node2-key.pem’;export ETCDCTL_CA_FILE=‘/etc/ssl/etcd/ssl/ca.pem’;/usr/local/bin/etcdctl –endpoints=https://192.168.1.113:2379,https://192.168.1.114:2379,https://192.168.1.166:2379 cluster-health | grep -q ‘cluster is healthy’”
: Process exited with status 1
配置文件:
`apiVersion: kubekey.kubesphere.io/v1alpha1
kind: Cluster
metadata:
name: sample
spec:
hosts:

You should complete the ssh information of the hosts

  • {name: node6, address: 192.168.1.113, internalAddress: 192.168.1.113}
  • {name: node1, address: 192.168.1.114, internalAddress: 192.168.1.114}
  • {name: node2, address: 192.168.1.166, internalAddress: 192.168.1.166}
    roleGroups:
    etcd:
    • node6
    • node1
    • node2
      master:
    • node6
    • node1
      worker:
    • node6
    • node1
      controlPlaneEndpoint:

      If loadbalancer was used, ‘address’ should be set to loadbalancer’s ip.

      domain: lb.kubesphere.local
      address: ""
      port: 6443
      kubernetes:
      version: v1.20.4
      clusterName: cluster.local
      proxyMode: ipvs
      masqueradeAll: false
      maxPods: 120
      nodeCidrMaskSize: 24
      network:
      plugin: calico
      kubePodsCIDR: 10.233.64.0/18
      kubeServiceCIDR: 10.233.0.0/18
      registry:
      privateRegistry: ""
      `

运行add添加节点命令后,etcd 日志Sep 07 14:09:55 node6 etcd[19921]: 2021-09-07 06:09:55.601038 E | rafthttp: request sent was ignored (cluster ID mismatch: peer[a3ef23c8ee30dd2a]=d9ca6e9d245ea8bb, local=fbad7c135d3aac5b)
。。。好像是节点更新了,要怎么处理,etcdctl执行失败。
[root@node6 etcd]# docker exec -it etcd1 sh

etcdctl member list

2021-09-07 06:11:47.904263 W | pkg/flags: unrecognized environment variable ETCDCTL_CA_FILE=/etc/ssl/etcd/ssl/ca.pem
2021-09-07 06:11:47.904323 W | pkg/flags: unrecognized environment variable ETCDCTL_CERT_FILE=/etc/ssl/etcd/ssl/admin-node6.pem
2021-09-07 06:11:47.904333 W | pkg/flags: unrecognized environment variable ETCDCTL_KEY_FILE=/etc/ssl/etcd/ssl/admin-node6-key.pem
{“level”:“warn”,“ts”:“2021-09-07T06:11:52.904Z”,“caller”:“clientv3/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“endpoint://client-c731149f-359f-480f-a9f3-72fa6685f943/127.0.0.1:2379”,“attempt”:0,“error”:"rpc error: code = DeadlineExceeded desc = latest balancer error: all SubConns are in TransientFailure, latest connection error: connection error: desc = \“transport: authentication handshake failed: x509: certificate signed by unknown authority\”"}
Error: context deadline exceeded