Troubleshooting
Following are some of the basic Docker Swarm commands that are useful for troubleshooting issues during the deployment:
To view Docker service-wise stats on the current server, run the following command:
docker stats
To restart the Docker service on the server, run the following command. This command restarts all services that run as Docker containers.
sudo systemctl restart docker
Note
You must manually restart the services that do not run as Docker containers.
To update a service, run the following command:
docker service update <service_name> --force
To go inside the containers, run the following command:
docker exec -it $(docker ls -q- -f name=<service_name>) bash
To go inside a specific container, run the following command:
docker exec -it <container_id> bash