Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud HTTP Load Balancer can't connect to my instance

I have created a HTTP load balancer to basically redirect from port 80 to port 8080. The server on my instance is running on port 8080. I can connect to the server directly but the LB is not able to connect to the instance, both accessing the LB's IP directly and also the health check always fails. The instance group the LB is using consist of just that single instance.

I read Google Compute Engine health checks failing and the google-address-manager is running. However, when running ip route table list local there is no routing for my LB. The user in the above question is using Network load balancing and not HTTP load balancing (as I am) so I don't know if that is related?

Or perhaps it's related to a firewall? I have added my LB's ip address to a firewall rule that allows tcp:8080

Does anybode have any idea how can I fix this? I am not experienced with debian nor gcp. Show I just try and run the route add command referenced in the above question? If so, how come the google-address-manager is not adding the route?

Thank you in advance!

like image 758
denen Avatar asked Feb 10 '16 09:02

denen


1 Answers

You need to make sure that your port mapping on instance group is set to correct port, the 8080 in your case.

First, edit your instance group and change the port name and port to 8080: enter image description here

Then, navigate to your http backend's settings and change the default port to the port name you've configured in your instance group.

enter image description here

Finally, make sure that your firewall rules allow access on port 8080 from 0.0.0.0/0 or at least from the IP address of HTTP load balancer (130.211.0.0/22)

like image 68
DoiT International Avatar answered Jan 02 '23 22:01

DoiT International