docker:Error response from daemon: error while validating Root CA Certificate: x509: certificate has expired or is not yet valid

created at 12-28-2021 views: 3

error

[root@localhost ~]# docker swarm join --token SWMTKN-1-10s4 10.10.185.111:2377
Error response from daemon: error while validating Root CA Certificate: x509: certificate has expired or is not yet valid

reason

It is because the cluster time is out of sync

solution

[root@localhost ~]# yum -y install ntp ntpdate

Next, synchronize the time and run it again

[root@localhost ~]# ntpdate cn.pool.ntp.org
22 Dec 09:53:13 ntpdate[7658]: step time server 111.230.189.174 offset 4811.754411 sec
[root@localhost ~]# docker swarm join --token SWMTKN-1-103xblwtdac0zck6h8s4 10.10.185.111:2377
This node joined a swarm as a manager.
[root@localhost ~]#
Please log in to leave a comment.