Endeca cluster setup with Apache load balancing - endeca

I configured endeca cluster with Apache load balancing of 2 dgraph.. both dgraph are running in different machine... Apache port 5555 used for load balancing...I have two application servers... I'm getting endeca response from only one dgraph not able to get the response from another dgraph and it give no record.... In which machine 5555 port must be running??? It should run both dgraph machine or web server machine???? Can you guys me for getting response from both dgraph.... I need to finish it quickly....
Thanks in advance,
thank you...
DgraphA1 - running in machine A
DgraphB1 - running in machine B (ITL Host)
App server1 pointing to DgraphA1 and Appserver2 pointing to DgraphB1.
Below things are configured in apache for endeca load balancing.I configured the listen port 5555 in Machine A apache..
For App servers, apache are configured in Machine A httpd.conf file.
NameVirtualHost *:5555
<VirtualHost *:5555>
ServerName MachineA
ProxyPass / balancer://dgraphs/
ProxyPassReverse / balancer://dgraphs/
<Proxy balancer://dgraphs>
BalancerMember http://MachineA:15000 loadfactor=1 retry=0
BalancerMember http://MachineB:15000 loadfactor=1 retry=0
</Proxy>
</VirtualHost>
<Location /balancer-manager>
SetHandler balancer-manager
</Location>

Figured it out myself.
Apache 5555 port need to Run in ITLHost(DgraphB1)
Both App server need to point the ITL Host(DgraphB1) and Port 5555.
Everything working fine..

Related

Load balancing between servers using Apache and JBoss

I am facing the following scenario: I have three servers, each with an instance of my application deployed in a standalone JBoss, I am trying to use a machine that will do the load balancing service between these three servers, for this I am using the module mod_proxy_balancer from Apache (or at least trying), and it was even easy to do the balancing, it worked correctly, however I am having problems in keeping users session and cookies, because whenever a new request is made, the balancer sends it to another server, causing that the user loses his session, I would like that when a user already had a session in one of the servers the same one was sent to him, or something of the type.
Is it possible to achieve the desired result using such resources? If so, how should I make such a setup? If not, what other tool or feature should I use?
Here's the virtual host configuration:
<VirtualHost *:80>
ServerName server.int
ProxyPass / balancer://balance/ stickysession=JSESSIONID|jsessionid scolonpathdelim=On
ProxyPass /balancer-manager !
ProxyPassReverse / balancer://balance/ stickysession=JSESSIONID|jsessionid scolonpathdelim=On
ProxyPassReverseCookiePath / /
<Proxy balancer://balance/>
BalancerMember "http://server1.int" loadfactor=50
BalancerMember "http://server2.int" loadfactor=25
BalancerMember "http://server3.int" loadfactor=25
ProxySet lbmethod=byrequests
</Proxy>
<Location /balancer-manager>
SetHandler balancer-manager
</Location>
</VirtualHost>
Although no one has answered, I will leave here the solution to my problem if this helps anyone in the future. I ended up using HAProxy that can do exactly what I needed in a very simple way.
frontend app
bind *:80
bind *:443 ssl crt /etc/haproxy/certs/cert.pem
redirect scheme https if !{ ssl_fc }
mode http
default_backend app
backend app
balance leastconn
mode http
option httpchk HEAD / HTTP/1.0
cookie SERVERID insert indirect nocache
server server1 server1.test.com:80 check weight 50 fall 3 rise 2 cookie server1
server server2 server2.test.com:80 check weight 50 fall 3 rise 2 cookie server2
server server3 server3.test.com:80 check weight 50 fall 3 rise 2 cookie server3

apache2 proxy balancer - passing server name

I'm using apache2 as a local proxy balancer between the web and a jboss machine.
i've used the following configuration:
<Proxy balancer://mycluster>
BalancerMember http://localhost:8080
</Proxy>
ProxyPass /test balancer://mycluster
if i call my machine with www.mymachine.com/test then the call is passed to JBoss, but in the request it seems that it was called with 'localhost'.
how can I make sure the correct server name is passed as well?
Aviad
all i needed to do is to add:
ProxyPreserveHost On

tomcat7 hot-standby Node with mod-cluster and Apache HTTPD2.2

I'm using tomcat7.0.63 with mod-cluster1.2.9 and Apache HTTPD2.2 on RHEL6.7
Multiple Tomcat-instances with dedicated balancer configurations are sharing the Apache HTTPD using dedicated Virtualhost:6666.
Only one Tomcat instance should have a Master-Node and a Hot-Standby Node.
I tried with mod-proxy-balancer, BalancerMember, with and without ModClusterListener in server.xml. But it seens the coexistence with mod-cluster on a shared Apache HTTPD is not working...or I make a mistake.
ProxyPass / balancer://mycl/
ProxyPassReverse / balancer://mycl/
<Proxy balancer://mycl>
BalancerMember ajp://1.2.3.9:8009 route=master retry=30
# The server below is on hot standby
BalancerMember ajp://1.2.3.4:8009 route=standby status=+H
</Proxy>
For JBoss EAP and Wildfly there is the lbfactor/loadfactor:
<simple-load-provider factor="0"/>
which makes one node to a hot-standby node.
Is there a way to do so with tomcat7, e.g. a mod-cluster Tomcat system-property which sends a load = 0 (standby) to Virtualhost:6666 ?
kind regards, hplar

Apache mod_proxy on Azure

I keep running into an issue with Apache's mod_proxy where it won't forward any traffic. I'm using a Windows Azure virtual machine running Ubuntu 13.04 and have configured the proper HTTPS endpoint (port 443) for it. The proper Apache modules (proxy, ssl, etc.) are all installed, and the error logs show nothing, not even a warning to explain why this is happening. My VirtualHost setup is as follows:
<VirtualHost *:443>
RequestHeader set X-Forwarded-Proto "https"
ProxyPreserveHost On
ServerName www.example.com
SSLEngine On
#SSLProxyEngine On
SSLCertificateFile /ssl/my.com.crt
SSLCertificateKeyFile /ssl/my.key
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
SSLRequireSSL
Order deny,allow
Allow from all
</Location>
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>
I have Listen 443 and NameVirtualHost *:443 all set as well. My service on the other port is running fine as doing a wget responds with an HTTP 200 OK response and I can reach it by manually inputting the port number. I have disabled all firewalls (for testing) to no avail as well. However, whenever I try to reach the service from the outside world through mod_proxy (port 443), the request times out and I get the usual "website not available" browser error.
If it means anything, the app I am running on the other port I need to forward HTTPS traffic to is a Play Framework 2.1 application. I set the server up exactly as in their documentation but still have these problems, so I'm assuming it may have something to do with Azure.
Any ideas? Is there some other type of endpoint configuration that I need to do specific for Windows Azure virtual machines to support SSL/TLS?
So, apparently, I have no idea how or why - but the Azure Gods decided to shine upon my setup all of a sudden. Overnight, without so much as a reboot or anything, mod_proxy on Azure just started working. I have no idea what the issue was, or even if there was one in the first place, but apparently the problem lies with something in the Azure infrastructure.
Sorry I couldn't be of more help for others encountering similar issues, but just giving it time worked for some unknown reason.

Mapping address to multiple tomcat instances

I have 3 tomcat instances running on Windows Server 2008 machine. Each one with one app:
http://host:8080/app0
http://host:8081/app1
http://host:8082/app2
How I can configure my server to map an address without the port number?
http://host/app0
http://host/app1
http://host/app2
Is it a tomcat configuration or something with DNS?
Thanks.
Ok, I tried the following:
Set up the Apache 2.2
Configure httpd.conf loading proxy modules
And add a proxy module configuration:
ProxyRequests Off
ProxyPass /app1 http://machine:8081/app
ProxyPassReverse /app1 http://machine:8081/app
<Location "/app">
Order allow,deny
Allow from all
</Location>
Now the redirect works well local in the machine. But it doesn't works when I try access from another machine in the same network. (this another machine can ping 'machine' host. And I tried putting the ip number too).
You can use nginx (http://nginx.org/en/docs/) as proxy for example.
Try simply (no load balancing etc.):
server {
listen here.your.ip:80/YourApp;
location / {
root /path/to/your/webapp;
proxy_pass http://host:8080/YourApp;
}
}
Same way for other ports
It is quite common to use multiple Tomcats behind Apache to do load balancing. While this is not load balancing the principle is the same. Instead of having one application with 3 load-balanced Tomcat workers, you would have 3 applications with 1 tomcat worker each.
You can find the tomcat documentation here: http://tomcat.apache.org/connectors-doc/
Try mod proxy configuration on below code in httpd:
ProxyPass /app0 http://localhost:8080/app0/
ProxyPassReverse /app0 http://localhost:8080/app0/
ProxyPass /app1 http://localhost:8081/app1/
ProxyPassReverse /app1 http://localhost:8081/app1/
ProxyPass /app2 http://localhost:8082/app2/
ProxyPassReverse /app2 http://localhost:8082/app2/