[root@k8s-master01 ~]# tail -f /var/log/messages
Dec 6 16:39:30 k8s-master01 etcd: setting maximum number of CPUs to 4, total number of available CPUs is 4
Dec 6 16:39:30 k8s-master01 etcd: ignoring peer auto TLS since certs given
Dec 6 16:39:30 k8s-master01 etcd: peerTLS: cert = /etc/kubernetes/pki/etcd/etcd.pem, key = /etc/kubernetes/pki/etcd/etcd-key.pem, trusted-ca = /etc/kubernetes/pki/etcd/etcd-ca.pem, client-cert-auth = false, crl-file =
Dec 6 16:39:30 k8s-master01 etcd: ignoring client auto TLS since certs given
Dec 6 16:39:30 k8s-master01 etcd: pprof is enabled under /debug/pprof
Dec 6 16:39:30 k8s-master01 etcd: The scheme of client url http://127.0.0.1:2379 is HTTP while peer key/cert files are presented. Ignored key/cert files.
Dec 6 16:39:30 k8s-master01 etcd: The scheme of client url http://127.0.0.1:2379 is HTTP while client cert auth (--client-cert-auth) is enabled. Ignored client cert auth for this url.
Dec 6 16:39:30 k8s-master01 etcd: name = k8s-master01
Dec 6 16:39:30 k8s-master01 etcd: data dir = /var/lib/etcd
Dec 6 16:39:30 k8s-master01 etcd: member dir = /var/lib/etcd/member
Dec 6 16:39:30 k8s-master01 etcd: dedicated WAL dir = /var/lib/etcd/wal
Dec 6 16:39:30 k8s-master01 etcd: heartbeat = 100ms
Dec 6 16:39:30 k8s-master01 etcd: election = 1000ms
Dec 6 16:39:30 k8s-master01 etcd: snapshot count = 5000
Dec 6 16:39:30 k8s-master01 etcd: advertise client URLs = https://192.168.1.110:2379
Dec 6 16:39:30 k8s-master01 etcd: cannot access data directory: directory "/var/lib/etcd","drwxr-xr-x" exist without desired file permission "-rwx------".
Dec 6 16:39:30 k8s-master01 systemd: etcd.service: main process exited, code=exited, status=1/FAILURE
Dec 6 16:39:30 k8s-master01 systemd: Failed to start Etcd Service.
Dec 6 16:39:30 k8s-master01 systemd: Unit etcd.service entered failed state.
Dec 6 16:39:30 k8s-master01 systemd: etcd.service failed.
Solution:
I read the official documents and said that the permissions are wrong. I want to give 700 permissions
# Then restart etcd
[root@k8s-master01 ~]# chmod 700 /var/lib/etcd/ -R