Load balancing in JBoss with mod_cluster - jboss

Got a general question about load balancing setup in JBoss (7.1.1.Final). I'm trying to setup a clustered JBoss instance with a master and slave node and I'm using the demo app here (https://docs.jboss.org/author/display/AS72/AS7+Cluster+Howto) to prove the load balancing/session replication. I've basically followed through to just before the 'cluster configuration' section.
I've got the app deployed to the master and slave nodes and if I hit their individual IPs directly I can access the application fine. According to the JBoss logs and admin console the slave has successfully connected to the master. However, if I put something in the session on the slave, take the slave offline, the master cannot read the item that the slave put in the session.
This is where I need some help with the general setup. Do I have to have a separate apache httpd instance sat in front of JBoss to do the load balancing? I thought there was a load balancing capability built into JBoss that wouldn't need the separate server, or am I just completely wrong? If I don't need apache, please could you point me in the direction of instructions to setup the JBoss load balancing?
Thanks.

Yes, you need a Apache or any other software or hardware that allows you to perform load balancing of the HTTP request JBoss Application Server does not provide this functionality.
For proper operation of the session replication you should check that the server configuration and the application configuration is well defined.
On the server must have the cache enabled for session replication (you can use standalone-ha.xml or standalone-full-ha.xml file for initial config).
To configuring the application to replicate the HTTP session is done by adding the <distributable/> element to the web.xml.
You can see a full example in http://blog.akquinet.de/2012/06/21/clustering-in-jboss-as7eap-6/

Related

Wildfly 10 session replication fails in domain mode

I followed instructions which is given at https://docs.jboss.org/author/display/WFLY10/Clustering+and+Domain+Setup+Walkthrough
I used mod_cluster 1.2.6 and wildfly 10. Slave node registers to master domain controller.
Load balancing is working as i seen but session replication is not working.
I realized artemismq configuration should be set up in domain.xml but it is not mentioned in documentation.
Is there something else to be configured.
If there is tutorial or sample configuration i will be really grateful.

jBoss EAP - full-ha profile required for stateless servers?

jBoss EAP 6.2 supports full and full-ha profiles (amongst others). In standalone deploy, we use domain mode with full profile for an app.
App that we have is primarily having/exposing RESTful services which are stateless - there is a administration web portal, but it is ok to not have session replication for this (i.e. if one server goes down, it is acceptable for users to lose the browsing session and login again). app does not make use of EJBs.
In deployment, if we have a hardware loadbalancer that is able to route requests to nodes in active-active mode, then, is it ok to just go with full profile on nodes and not use the full-ha profile ? or is there a benefit to be got from using the full-ha profile? using the former approach simplifies deployment and makes spinning up a new VM with the app relatively easier.
Any inputs/directions/pointers in this regard would be most useful.
The used JBoss profile depends on what you need from it. standalone-full-ha provides Infinispan, Web-Session and HornetQ (JMS) replication whereas standalone-ha provides no JMS.
You can run active-active clusters with load balancers in front with the standalone profile as long as you do not replicate data/states using JGroups, Infinispan and so on.

Prevent deployment to entry node, only deploy to other nodes

I have a free OpenShift account with the default 3 gears. On this I have installed the WildFly 8.1 image using the OpenShift web console. I set the minimal and maximal scaling to 3.
What happens now is that OpenShift will create 3 JBoss WildFly instances:
One on the entry node (which is also running HAProxy)
One on an auxiliary node
One on another auxiliary node
The weird thing is that the JBoss WildFly instance on the entry node is by default disabled in the load balancer config (haproxy.conf). BUT, OpenShift is still deploying the war archive to it whenever I commit in the associated git repo.
What's extra problematic here is that because of the incredibly low number of max user processes (250 via ulimit -u), this JBoss WildFly instance on the entry node cannot even startup. During startup JBoss WildFly will throw random 'java.lang.OutOfMemoryError: unable to create new native thread' (and no, memory is fine, it's the OS process limit).
As a result, the deployment process will hang.
So to summarize:
A JBoss WildFly instance is created on the entry node, but disabled in the load balancer
JBoss WildFly in its default configuration cannot startup on the entry node, not even with a trivial war.
The deployer process attempts to deploy to JBoss WildFly on the entry node, despite it being disabled in the load balancer
Now my question:
How can I modify the deployer process (including the gear start command) to not attempt to deploy to the JBoss WildFly instance on the entry node?
When an app scales from 2 gears to 3, HAproxy stops routing traffic to your application on the headgear and routes it to the two other gears. This assures that HAproxy is getting the most CPU as possible as the application on your headgear (where HAproxy is running) is no longer serving requests.
The out of memory message you're seeing might not be an actual out of memory issue but a bug relating to ulimit https://bugzilla.redhat.com/show_bug.cgi?id=1090092.

JBOSS AS 7 Load Balancing with Server Failover

I have 2 instances of Jboss servers running on eg: 127.0.0.1 and 127.0.0.2.
I have implemented Jboss load balancing, but am not sure how to achieve server failover. I do not have a webserver to monitor the heartbeat and hence using mod_cluster is out the question. Is there any way I can achieve failover using only the two available servers?
Any help would be appreciated. Thanks.
JBoss clustering automatically provides JNDI and EJB failover and also HTTP session replication.
If your JBoss AS nodes are in a cluster then the failover should just work.
The Documentation refers to an older version of JBoss (5.1) but it has clear descriptions of how JBoss clustering works.
You could spun up another instance to server as your domain controller, and the two instances you already have will be your hosts. Then you could go through the domain controller, and it will do the work for you. However, I haven't seen instances going down to often, it usually servers that do, and it looks like you are using just one server (i might be wrong) for both instances, so i would consider splitting it up.

Adding standalone zookeeper servers into fabric ensemble

We're attempting to add standalone zookeeper servers into the zk ensemble ran by fuse fabric (as either followers or observers). However, it looks like fabric has pretty tight control over the zk configuration and I haven't been able to find any documentation relating to adding hardcoded server configuration params to the dynamic ones used by fabric. Anyone else try this or have some idea of where to look?