Google compute engine load balancing not routing properly - load-balancing

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?

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.

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

Related

Weblogic load balancing and request re-routing to another server

I'm totally new to clustering and load balancing.
What I'm trying to do is "Deploy Application on a Cluster which contains 2 managed servers. Now, If one of the managed server goes down, request should be redirected to another server which is Up."
For Example:
I've 2 managed servers (M1:7021 and M2:7022)
And I've a Cluster C1 having M1 and M2.
And I've an Application App1 deployed on C1 and a Data Source deployed on C1.
Application App1 is working fine.
The way through which I'm accessing application is:
http://10.184.111.11:7021/App1/
AND
http://10.184.111.11:7022/App1/
Now, Suppose if M1(7021) goes down, and request is coming like
:7021/App1/
Then, it should be redirected to :7022/App1/
Any help is highly appreciated. Thanks!
I believe you will need a load balancer (or a software equivalent) to sit above the weblogic servers and direct traffic down to those servers.
The idea being that you access your application on http://loadBalancer.com/App and then the Load Balancer forwards your request onto either one of weblogic servers. Meanwhile in the background the load balancer is continually performing health checks on the two weblogic servers to see if they are running.
In the event that one of the weblogic servers go down, the load balancer will mark it as inactive and forward all traffic to the weblogic server still running. Once the failed weblogic server has come back online the load balancer will begin routing traffic back through it.
#Garreth Well, in fact WebLogic DOES provide an internal load balancer. You are supposed to use OHS or Apache for load balancing in production environments, but for development, httpclusterservlet works great.

Difference Between Load Balancing and Load Balancer

I need to know the difference between a load balancer and load balancing.
Load balancing is the functionality provided by a Load balancer :).
In software architecture, a load balancer proxies client requests to a pool of application server, using an algorithm, with the objective of balancing the load of client requests evenly across the pool
Load balancing refers to efficiently distributing incoming network traffic across a group of backend servers, also known as a server farm or server pool.
A load balancer acts as the “traffic cop” sitting in front of your servers and routing client requests across all servers capable of fulfilling those requests in a manner that maximizes speed and capacity utilization and ensures that no one server is overworked, which could degrade performance. If a single server goes down, the load balancer redirects traffic to the remaining online servers. When a new server is added to the server group, the load balancer automatically starts to send requests to it.
refer - https://www.nginx.com/resources/glossary/load-balancing/
Load Balancing helps spread incoming request traffic across cluster of servers. If a server is not availble to take a request, load balancer passes this request to another server.
Load Balancer in turn are the ones which achieve above, they could come in between :-
User - webserver
Webserver - internal application servers
Internal servers - database servers
Application servers - cache servers
Different types of Load Balancers:
Smart Client - Adding load balance achievability by It is a client which takes a pool of service hosts and balances load across them, detects downed hosts and avoids sending requests their way.
Hardware Load Balancer - Buy your own dedicated high performance server eg. Citrix NetScaler.
Software Load Balancer - Buy a software load balancer to overcome all the pain of building your own smart client or if you not ready spending on dedicated server. Cost effective than above two is buying a software load balancer eg. VmWare, HAProxy etc
As per my knowledge both are same but you can say that the load balancer is the device used for balancing the traffic as per the availability of the server and load balancing is nothing but theoretical explanation for how to achieve this.
Please correct me if I'm wrong!

Coherence web and load balancing

We had 2 managed servers sitting behind a Citrix Netscaler loadabalncer with sticky session enabled, so a request will be forwarded to the same managed server.
Now we configured a coherence*web cluster with 2 managed servers and a Citrix Netscaler as load balancer sitting in the front. How do we call the coherence cluster from the loadbalancer without calling the managed servers? Is there any IP address for the coherence cluster that we need to call from the netscaler or how to call the cluster without calling individual servers?
Thanks a lot.
You keep the same config that you had before for load-balancing to the web or application servers.
Coherence*Web makes sure that the data in the sessions will be shared between those servers (even if you add and remove servers dynamically!), and will not be lost if one server dies.

GCE load balancer can not call from inside

I use CoreOS on Google Compute Engine, to launch 3 instances: core1, core2, core3
I use Fleet to start a web service container on one of the three instances (ex: core1).
Because I don't know which machine the container is on, so I use Network Load Balance to forward request to the container, with the Targer Pool contain 3 machines
The issue is that I can not curl the load balancer IP from the core2 or core3 machine.
I expect the load balancer should forward the request to web serivce container on core1. How do I do that?

Glassfish 3.1 loadbalancing setup

I am very new to server setup. I have a cluster with 2 instances in GF.
instance1:28081
instance2:28082
I am running my GF in Amazon Linux EC2 instance. What are the options to create a load balancer setup that directs traffic to these instances when I try to access my EC2 instance http 80 port?
1) Do I need to have a webserver to direct traffic to these instances?
2) Is there any options in Glass fish which can handle load balancing without a webserver on these instances? I couldn't find load balancing configuration on my admin console.
3) Is there a way to use Amazon Load balancing to distribute traffic to these cluster instances which resides in a single ec2 instance?
If some one can provide step by step instructions/link reference that would be helpful.
I did a nice write up on loadbalancing/failover and proxy options for GlassFish.
have a look: http://blog.eisele.net/2012/01/throwing-light-on-glassfish-webserver.html