0

I get start with docker and when I try this command :

$ docker service list

in my server, I get this error message

*Error: Swarm certificates have expired. To replace them, leave the swarm and join again*.  

As the error says, I must leave the swarm and join it again . But the problem is that I don't have the swarm's token, adresse and port. I don't also know which node is the swarm manager.
The command

$ docker info
 gives me the following output :   
Containers: 0  
 Running: 0  
 Paused: 0  
 Stopped: 0  
Images: 149  
Server Version: 1.13.0  
Storage Driver: aufs  
 Root Dir: /var/lib/docker/aufs  
 Backing Filesystem: extfs  
 Dirs: 226  
 Dirperm1 Supported: false  
Logging Driver: json-file  
Cgroup Driver: cgroupfs  
Plugins:   
 Volume: local  
 Network: bridge host macvlan null overlay  
Swarm: error  
 NodeID:   
 Error: Swarm certificates have expired. To replace them, leave the swarm and join again.  
 Is Manager: false  
 Node Address: 172.30.4.4  
Runtimes: runc  
Default Runtime: runc  
Init Binary: docker-init  
containerd version: 03e5862ec0d8d3b3f750e19fca3ee367e13c090e  
runc version: 2f7393a47307a16f8cee44a37b262e8b81021e3e  
init version: 949e6fa  
Security Options:  
 apparmor  
Kernel Version: 3.13.0-108-generic  
Operating System: Ubuntu 14.04.2 LTS  
OSType: linux  
Architecture: x86_64  
CPUs: 2  
Total Memory: 3.861 GiB  
Name: london-pop  
ID: 3O2U:VE5T:CMZU:HZUW:H3FR:ATB3:HRQE:Q2PI:BEOY:VS4T:4L4L:X276  
Docker Root Dir: /var/lib/docker  
Debug Mode (client): false  
Debug Mode (server): false  
Username: maouadj  
Registry: https://index.docker.io/v1/  
WARNING: No swap limit support  
Experimental: false  
Insecure Registries:  
 127.0.0.0/8  
Live Restore Enabled: false"  

Can someone tells me how can I solve the problem of swarm certificat expiration or how can I abtain swarm token, Ip address and port from a worker node, please? NB : Almost all docker swarm swarm command gives me the same error :

Error: Swarm certificates have expired. To replace them, leave the swarm and join again.

Mehdi Yedes
  • 2,267
  • 2
  • 14
  • 14
Enock
  • 11
  • 1
  • 6

1 Answers1

0

After leaving the swarm using

$ docker swarm leave

It's always possible to get the join command from a swarm manager node without the need for recreating the whole cluster. The command docker swarm join-token will provide you with the command needed for that:

$ docker swarm join-token worker
To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-0g9sxv0seaovqakgmyobizjhqgazmhra4gn5lnjpczzscfmxpv-ct131a54ghh2igx6v1st0txw4 192.168.65.3:2377

$ docker swarm join-token manager
To add a manager to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-0g9sxv0seaovqakgmyobizjhqgazmhra4gn5lnjpczzscfmxpv-65otgvl9wm9w3h5agq3wvei4u 192.168.65.3:2377

Ref: https://docs.docker.com/engine/reference/commandline/swarm_join/

Mehdi Yedes
  • 2,267
  • 2
  • 14
  • 14
  • does not work ```docker swarm join-token manager``` => ```Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.``` AND ```docker swarm join-token worker``` => ```Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.``` – uberrebu Jun 19 '22 at 05:56