-1

In my swarm docker-compose file I am creating 7 replicas of apache storm supervisor as shown here.

storm_supervisor:
  image: storm:2.0.0
  deploy:
    replicas: 7
  command: storm supervisor
  networks:
    - my_network
  hostname: "stormsupervisor{{.Task.Slot}}"

However the hostname that I am setting is not being resolved anywhere within the swarm network. i.e. when I exec into the zookeeper container running on the same swarm network, I cannot ping "stormsupervisor1, "stormsupervisor2, etc. Instead I can only ping them by their respective container id. I can also ping using the service name (storm_supervisor), but that only returns one of the containers

Bob C.
  • 141
  • 2
  • 15

1 Answers1

0

The host keyword is used to set the hostname of the container in /etc/hosts and /etc/hostname, it is not used at all with the swarm service discovery. check this link for more info

Al-waleed Shihadeh
  • 2,697
  • 2
  • 8
  • 22