Docker Community Forums

Share and learn in the Docker community.

Does 'docker ps' show running containers on more than 1 node in a swarm? Proving redundancy & load balancing?


(Khamil8686) #1

I need to prove Docker Swarm redundancy and failover of a swarm of nodes. I have a swarm of 3 manager/worker nodes because we want redundancy and I heard it is better to use an odd number of managers with raft, so I decided on having at least 3 managers. I created an overlay network, which has two nginx containers with a basic string as a webpage, and a reverse proxy. A visitor can go to any of the swarm hosts and be redirected to one of the nginx containers based on the path passed in.
I figured this would be easy. To show redundancy, I would just show killing a container and visiting the appropriate URL to show that a new container was launched. To show load balancing, I would just tail the logs in running containers while visiting the same page multiple times and recording which containers were hit each time.
Things aren’t working as I thought they would. When I run ‘docker ps’ I assumed that I would see the containers running on whichever node I ran the command on. Instead, when I run the command I only see running containers on the first node I set up. If I run the command on the second, or third node, I don’t see any containers running. I can visit the address of every node and correctly be redirected to the appropriate website based on URL given. So, it works great! I just can’t prove that it is working.
Does anyone have any insight on how I can prove redundancy and load balancing? Is what I am seeing expected behavior?

Thank you,