Google compute engine load balancing not routing p

2019-07-14 08:52发布

问题:

I am new to Google compute engine and I am try to setup network load balancing having 2 VMs for serving web pages.

For ex, I have 2 VMs - app1 and app2 - both having apache server and serves simple web page.

Both VMs are running with Red Hat Enterprise Linux Server release 7.0 (Maipo)

I am able to access both web pages through the IP in browser.

I created network load balancing setup and both apps are showing in green in target pool which means load balancer is able to connect to both VMs.

But, when I hit the IP of load balancer, it is rendering page from only one server. If I manually stop the server in the VM, load balancer IP redirects to other app. I believe load balancer is able to identify health of both VMs and able to redirect.

But it is not balancing the traffic. Can anyone help me to solve this issue?

回答1:

I think that the network load balancer doesn't forward the traffic on a round-robin basis. I was able to test it with the load balancer setup that I have. As per the documentation:

By default, to distribute traffic to instances, Google Compute Engine picks an instance based on a hash of the source IP and port and the destination IP and port.



回答2:

HTTP/S load balancing will proxy requests in a round-robin fashion. https://cloud.google.com/compute/docs/load-balancing/http/