spring-petclinic/spring-petclinic-microservices

Facing issue in loading spring-petclinic microservices with Docker Swarm multi-node configuration

odidev opened this issue · 2 comments

odidev commented

@arey, I have set up the multi-node deployment. I have created the docker swarm cluster by using the docker swarm init --advertise-addr <Manager node IP> command.

Next, I used the docker swarm join --token <TOKEN> <Manager Node IP>:2377 command to add the worker nodes to cluster.

I have created seven worker nodes for seven services. Then I verified the nodes by using Sudo docker node ls command.

ID                            HOSTNAME           STATUS    AVAILABILITY   MANAGER STATUS   ENGINE VERSION
32arcot0qa8sjfxcypigna8cp     ip-172-31-16-111   Ready     Active                          20.10.25
x7h1sacihh4o2su0f2rmd16lg     ip-172-31-16-193   Ready     Active                          20.10.25
yz51eucb7l5xau7hjf10591yj     ip-172-31-24-215   Ready     Active                          20.10.25
23zdqlny4s5wf7sae9r380sy5     ip-172-31-27-149   Ready     Active                          20.10.25
i0fit4xgcn2rfar8244obg1u6     ip-172-31-27-211   Ready     Active                          20.10.25
hqwoms0zvdyy0p82vnccoetsu *   ip-172-31-28-164   Ready     Active         Leader           20.10.25
l5l8svnurod1xh5pvfor7a852     ip-172-31-29-225   Ready     Active                          20.10.25
tqbacbsd4ss86qfuk16lx5dza     ip-172-31-31-143   Ready     Active                          20.10.25

I have created an overlay network on with docker container are going to communicate from different nodes. So, I have used docker network create -d overlay testservice command to create an overlay network.

After creating the network, I have created a docker-swarm file, which is mentioned below:

Docker-swarm file: docker-swarm.txt

Deployed the container over the docker swarm cluster using this Sudo docker stack deploy -c docker-compose-swarm.yml springpetclinic. I have checked all the container in which state by using sudo docker stack ps springpetclinic

ID             NAME                                  IMAGE                                              NODE               DESIRED STATE   CURRENT STATE            ERROR     PORTS
5q400hewad81   springpetclinic_admin-server.1        odidev/spring-petclinic-admin-server:latest        ip-172-31-20-25    Running         Running 10 seconds ago
i09wp09s2vfl   springpetclinic_api-gateway.1         odidev/spring-petclinic-api-gateway:latest         ip-172-31-30-174   Running         Running 11 seconds ago
vqsmb8s0za2s   springpetclinic_config-server.1       odidev/spring-petclinic-config-server:latest       ip-172-31-27-215   Running         Running 9 seconds ago
uwt4zvp18e04   springpetclinic_customers-service.1   odidev/spring-petclinic-customers-service:latest   ip-172-31-17-224   Running         Running 7 seconds ago
743xp6fego31   springpetclinic_discovery-server.1    odidev/spring-petclinic-discovery-server:latest    ip-172-31-21-100   Running         Running 7 seconds ago
6uy71i7kt4at   springpetclinic_tracing-server.1      openzipkin/zipkin:latest                           ip-172-31-26-224   Running         Running 4 seconds ago
ze1jkmzitxsd   springpetclinic_vets-service.1        odidev/spring-petclinic-vets-service:latest        ip-172-31-23-208   Running         Running 10 seconds ago
q7k51e2148k7   springpetclinic_visits-service.1      odidev/spring-petclinic-visits-service:latest      ip-172-31-21-100   Running         Running 7 seconds ago

Now, when I check the UI on local browser with https://<Any worker node IP>:<port number>. It can communicate only with the main page; The other web service is not able to communicate to other services.

image

image

Could you please share some pointers for the same? Let me know if you need any other information.

arey commented

Hi @odidev
I hope you found a solution to this communication issue. I don't know Docker Swarm and unfortunately cannot help you.

arey commented

Please reopen if needed