Load Balancing with Tomcat - tomcat7

This may sound a basic question...
But I am new to concept of load balancing and had few questions.
Scenario - I have 3 Tomcat 7 servers which I want to be load balanced.
I read few articles and saw that using Apache HTTP Server one can do this.
There exists a worker.properties file which needs to be defined with the servers you would like to load balance. Now the problem is that this needs to be done before I start the Apache HTTP Server.
Problem - What if I want to add few more Tomcat Servers dynamically without restarting the Apache HTTP Server. Is this possible ?
Regards
Ajax

I spot an interesting article about Tomcat & PAAS: http://www.devx.com/Java/Article/48086
You will probably find what you need in the article. It describes the mechanism to register / unregister a new node in the cluster.
HIH

Apache HTTPD 2.4 supports dynamic reconfiguration of the load balancer. But use the load-balancer proxy module for this, not mod_jk.

Related

Move Confluence to subdomain (no port) on JIRA server, with Tomcat

I'm using both JIRA and Confluence on the same server, running on Windows, using Apache Tomcat.
I have two domains pointing at the server, jira.company.com and confluence.company.com.
JIRA is running fine on port 80 in the Apache Tomcat instance, and I can get to that on the JIRA.company.com domain just fine.
Confluence is currently running on port 8090 on the same machine. What I'm trying to do is get Confluence working on the confluence.company.com domain.
Most of the documentation I can see is about configuring virtual hosts and reverse proxies in httpd.conf, however in Apache Tomcat all I have to work with is the server.xml file.
I understand I can add another host to the JIRA server.xml file to point to a different docBase for Confluence, but I have a feeling this breaks Atlassian's own recommendations found here.
When I add an additional host entry into Confluence's server.xml it's ignored, and the confluence.company.com domain sends me through to JIRA.
I've done some searching and found similar questions but they don't seem to apply to my configuration - they all mention httpd.conf which isn't present on my server.
My questions:
Can I run Confluence on the subdomain by adding an extra entry in JIRA's server.xml? If possible, is this bad?
Is there another way to get my Confluence Apache instance listening on port 80 but on it's own domain name?
I can do all this on IIS with my eyes shut, but in Apache/Tomcat I'm a little lost. Thanks in advance!
Tomcat is not really meant to directly handle incoming requests as usually an Apache or other proxy is put in front of it to hide the ports and provide other useful features you would need for Single Sign On etc. Note that there is a difference between the Apache Webserver, which is commonly only called "Apache" and "Apache Tomcat", which is only an application server made by the Apache Foundation community and named "Tomcat". Tomcat only supports basic webserver functionality.
In any case, you can use the IIS as a webserver and proxy to forward the requests and at the same time hide the ports of the applications. I personally haven't used IIS but Atlassian offers a thorough explanation for the Confluence and/or JIRA integration with IIS as a proxy: https://confluence.atlassian.com/adminjiraserver071/integrating-jira-applications-with-iis-802593039.html
The page covers JIRA for the most part but section 4 also has additional information if you want to hook up both JIRA and Confluence on the same server, which is exactly your use case.

Does Mesos-dns provides load balancing?

I was looking at Mesos + Marathon to manage Docker containers.
What we're trying to achieve is a way of getting an external DNS entry (test.example.com) to point to a specific set of docker containers.
The DNS entry for test.example.com points to a load balancer which translate and send the connection to one of our backend servers app.
To do this I looked into Mesos-dns. With mesos-dns I can get DNS name for each container and can resolve DNS with container IP but couldn't find out way to load balance between set of servers.
Can someone confirm if Mesos-dns provides load balancing? If yes, how can I achieve load balancing with it?
Do I need to use some other solutions like HAProxy or Bamboo to achieve this?
Thanks!!
Sumit
Yes with Mesos-DNS you can do load balancing, see for example the respective HTTP API endpoints, but it's really not recommended in the context of DC/OS: see the internal (Minuteman) and external (Marathon-lb, HAProxy-based) load balancing and service discover options in the docs.

WSO2 WSAS Application Server and ELB not working

I succesfully followed the guides on http://docs.wso2.org/display/Cluster/Clustering+Application+Server and have deployed an scenario of one ELB 2.1.0 balancing and connecting the nodes as follows:
- One machine with the ELB, Manager and Worker node
- Another physical different machine with another worker node
All the managing on the ELB and manager and workers seems to be fine, for the logs and the console show every member connecting to each other, and so.
My problem is that if I configure the "proxyPort" properties on the Catalina-server.xml of the Manager and the workers node, I can't connect trhough the ports on the ELB 8280 or 8243, because I am obtaining a blank page (if i try to use the manager administration console) or a blank webserver response (if I try to consume any webservice through the ELB port).
If I don't configure the proxyPorts properties on each node, and point to each IP and port separately, I can successfully use the manager console, and consume the WebServices on each worker node as I expected but...of course, this way I am not having Load Balance and High Availability.
Sorry to bother you because I'm new at this matters, but I searched the internet all around and have found how to fix problems all the way through this point I'm in... It seems that the problem should only be at some transportation level configuration on the axis2.xml of some node, or maybe the fact our network is behind a proxy had something to be...don't know.
¿Anybody could give any advice? Versions are: WSAS 5.2.0 and ELB 2.1.0.
We have found now, that working with previous versions (with Tribes and not Hazelcast as the clustering class), WSAS 5.1.0 and ELB 2.0.3, and not changing the parameter on the Axis2.xml file in the ELB (leaving as it comes, being different than the domain established in the loadbalancer.cfg and the domain in the Axis2.xml of the Workers and Managers), it works well. But, if we don't change the on the axis2.xml working with the 5.2.0 and 2.1.0 versions, trying to replicate the status we have with the previous version, the ELB doesn't realice that a manager and worker are connecting to him (we can't see anything on the ELB logs when launching the manager and Worker), so I suppose in this case the clustering is not working, and for it to work properly, we need to set the in the Axis2.xml of the loadbalancer the same as in the loadbalancer.conf and in the axis2.xml of the rest of nodes in the cluster.
We need to deploy this for testing and valoration purposes on a customer and we would like to understand or to know if there is something wrong with the last versions, or this is just a lack of knowledge for our part, case when we will need the help of this forum :).
In this link you could find the configuration files involved in the ELB 2.1.0 and Manager WSAS 5.2.0 issue: http://www.dravencrow.com/varios/configuration_files.rar
Thank you very much in advance
Just for the sake of others with the same problem, we finally worked this out. It seems that with the newest versions of ELB (2.1.0) you need to stablish the port where to listen to other members in the "loadbalancer.conf" level, with the property "group_mgt_port", which did not comes as default in the file from the release of ELB 2.1.0. Also, the domain fixed in the Axis2.xml of the ELB level must be totally different from the domain fixed in the rest of Axis2.xml files of other nodes (and from the domain in the loadbalancer.conf itself). With this setup, the last version of ELB and AS works fine taking care of connections between each other, and the proxyports works as well connecting to manager and workers throug the elb port 8243. Thank you very much for your patience and apologies for bothering you....it's really difficult find some reliable documentation on the last versions of each product in the WSO2 suite, for the most of the info available is spreaded through different blogs and forums. Regards

Ajax: load data from same server but different port

My main web application is on apache, but sometimes I need to import some pages/data from tomcat server running on same machine. Now Ajax doesn't allow me to request data from tomcat due to "Single Origin Policy".
So how can I implement the import of data from tomcat? One solution could be to use iframes. However someone suggested using relative urls. How do I implement that?
Use the Apache Tomcat Connector (mod_jk). This is used to tell Apache that certain resources will be served by Tomcat (much like mod_php/ mod_perl, etc.). Then your requests go to the same server and you get the added bonus of being able to apply all Apache's stuff to your servlets.

WebServices load balancing using Oracle WebCache?

I am using JBoss 5.1.0.GA on Red Hat Linux 4. We have only webservices deployed on this application server as .war files (servlets only, no stateful applications present). As a part of our architecture change for improving scalability, we are planning to have multiple JBoss servers running (may or may not be on different IP's and machines) and have a load balancer in front of them to distribute the load. Some of those I know recommended Oracle WebCache for load balancing.
When I started using it, I am able to load balance between the JBoss home page, i.e., requests for viewing the http://loadbalancer-hostname:8080/ brings up the actual JBoss home pages for both the servers in a round robin fashion.
I am trying to simulate external load on the webservices and started using soapUI plugin for NetBeans to do this. When I import the WSDL using the loadbalancer-hostname, it is imported fine, but when I load test it, the requests always go to the same server. My assumption is : When soapUI imported the WSDL, the actual WSDL file would have its <soap:address location="http://actual-server:8080/...?wsdl">. May be this is causing soapUI to always hit the same server.
My question is does Oracle WebCache perform load balancing for webservices as well ?
Yes it can.
A web service URL is like any other URL to the load balancer.
What's most likely happening in your case is the DNS look up is getting cached within the JDK on the consumer side of the web service.
Within Java, once a DNS is looked up, it caches the IP address via the networkaddress.cache.ttl property in %JRE%\lib\security
See this link for more:
http://www.rgagnon.com/javadetails/java-0445.html

Resources