Hi, I was able to follow the quick start guide step-by-step to create a multi-container application on a console-only CentOS7 server, from where the Rancher server is launched. All services are up and running, but I can’t hit the CentOS7’s public IP to get to the loadbalancer. How can I route the traffic from the CentOS7 (public IP address) to the loadbalancer (in my case, 172.17.0.9) for the mywordpress service? I tried to put a haproxy on the CentOS7 to route the traffic to the loadbalancer, but doesn’t seem to work. Below are the yml’s retrieved from the RancherUI. Thanks in advance for any help!
I am able to take your exact docker-compose.yml and rancher-compose.yml files and import them into my version of Rancher (v0.42.0). From there, I can take the host IP that has the load balancer and access the wordpress container.
What happens when you access the host IP? Is there an error (503) or a blank page?
Thanks for your reply Denise! Below is a brief description of a pseudo deployment topology. When I access http://192.168.0.100, I got “This web page is not available” error with “ERR_CONNECTION_REFUSED” when using Google Chrome, basically, 504, can’t reach out to the LB.
Client - Google Chrome on Windows (192.168.0.10)
Linux VM (CentOS7, 192.168.0.100)
Rancher Host (172.17.0.9)
wordpresslb service - lb agent(10.42.126.40)
mywordpress service - Default_mywordpress_1(10.42.214.176), Default_mywordpress_2(10.42.161.50)
database service - Default_Database_1(10.42.72.129)
Now, I did make it working by setting up a haproxy on the Linux VM (192.168.0.100) to route the traffic from 192.168.0.100 to 10.42.126.40, with the haproxy.cfg look like the following:
@denise - The last two sections of the haproxy.cfg file for the LB (10.42.126.40) container would look something like the following:
frontend 1a9b7308-805a-4212-abf0-8a80bce80b58_frontend
bind 10.42.126.40:80
mode http
default_backend 1a9b7308-805a-4212-abf0-8a80bce80b58_0_backend
backend 1a9b7308-805a-4212-abf0-8a80bce80b58_0_backend
mode http
balance roundrobin
server 171c9673-908f-4343-b1d5-35c6eaa04e90 10.42.214.176:80
server e6db7bf6-a9a6-4a0b-b9d6-0f9368ecb542 10.42.161.50:80
Once again, here’s the topology:
Client - Google Chrome on Windows (192.168.0.10)
Linux VM (CentOS7, 192.168.0.100)
Rancher Host (172.17.0.9)
wordpresslb service - lb agent(10.42.126.40)
mywordpress service - Default_mywordpress_1(10.42.214.176), Default_mywordpress_2(10.42.161.50)
database service - Default_Database_1(10.42.72.129)
So, from the outter Linux VM (IP: 192.168.0.100), it doesn’t seem to have a route to the inner LB (10.42.126.40). Or, am I missing something important here?
Can you confirm if the host has the correct IP or the docker bridge IP? You can set the IP specifically by following the docs for setting up a host on the same VM as rancher server.