title: Docker swarm load balancing - How to give common name to the service?
body: <p>I read <a href="https://docs.docker.com/engine/swarm/ingress/#publish-a-port-for-tcp-only-or-udp-only" rel="nofollow noreferrer">swarm routing mesh</a></p>
  
  <p>I create a simple service which uses tomcat server and listens at 8080. </p>
  
  <p><code>docker swarm init</code> I created a node manager at node1.</p>
  
  <p><code>docker swarm join /tokens</code> I used the token provided by the manager at node 2 and node 3 to create workers.</p>
  
  <p><code>docker node ls</code> shows 5 instances of my service, 3 running at node 1, 1 running at node 2, another one is at node 3.</p>
  
  <p><code>docker service create image</code> I created the service.</p>
  
  <p><code>docker service scale imageid=5</code> scaled it.</p>
  
  <p>My application uses atomic number which is maintained at JVM level.</p>
  
  <p>If I hit <code>http://node1:8080/service</code> 25 times, all requests goes to node1. How dose it balance node?</p>
  
  <p>If I hit <code>http://node2:8080/service</code>, it goes to node 2.</p>
  
  <p>Why is it not using round-robin?</p>
  
  <p><strong>Doubts:</strong></p>
  
  <ol>
  <li>Is anything wrong in the above steps?</li>
  <li>Did I miss something?</li>
  <li>I feel I am missing something. Like common service name <code>http://domain:8080/service</code>, then swarm will work in round robin fashion.</li>
  </ol>
  
  <p>I would like to understand only swarm mode. I am not interested external load balancer as of now.</p>
  
  <p>How do I see swarm load balance in action? </p>