This blog contains a video tutorial on how to setup up HTTP session failover using WildFly 8. Specifically, it shows:
- Introduction to WildFly and Managed Domain concepts
- Setup up a 2-instance cluster
- Deploy a WAR file to the cluster using centralized administration from admin console
- Access the application on one node and add HTTP session attributes on it
- Shutdown that instance and show HTTP session failover by accessing the application on other instance
Enjoy!
Hello, Arun.
How are you?
Congrats for great article, really very cool.
Where I can get package http-1.0-SNAPSHOT.war ? I’d like to do some test in my lab.
The package is private or public?
Thank you.
You can check out the workspace at https://github.com/arun-gupta/wildfly-samples/tree/master/clustering/http and build it yourself.
Arun,
Thanks for the great article! I have one question – do we have to use Apache httpd for fail-over? If so, do we install Apache httpd together with WildFly? Would Apache httpd then replaces functionality of Undertow?
Yu
Yu,
Apache httpd will only be the front end proxy. A future version of WildFly 8 will allow Undertow to be used as proxy as well, but not in WildFly 8.
Arun,
Thanks for reply! It’s the answer I am looking for.
Yu
Are sessions replicated on allnodes or just nodes in a server group? Thanks!
Jim,
By default, sessions are replicated on all nodes in a server group.
Hi Arun,
Its a great article.. Thanks for that! I have one question for you, I am using 1 ELB and 2 Cent OS application server instance with JBoss. Where do you suggest to put the Domain controller? As that instance goes down then how system will work?
Thanks
Benay
Domain Controller is used only for the administration purpose and is not used during runtime. The requested is routed to the server-group with individual instances.
Domain Controller can be placed on either of the machine, or even on a separate machine as well.
Hi Arun,
Thanks for your reply, Its save my lots of time!
Hello Arungupta,
Gr8 video..!!! i have configured my clustering jboss wildfly 8 by ur way,the war file is working in different ports.But i configured and connect localhost/mywarfile.xhtml with http 2.2.26 + mod_cluster combination to connect jboss wildfly and it is not working.so could you please help me out from this issue?
Mohammad,
What error are you getting ?
Have you tried https://docs.jboss.org/author/display/WFLY8/WildFly+8+Cluster+Howto ?
Hello Arun,
I have configured server-three as http:8340/mywar and server four as http:8440/mywarfile.if i started the jboss server i am able to access the locahost/myfilewar but when i stopped the server three i am getting below error.
I am getting 503 Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
can you please tell what went wrong?
Thanks & Regards,
Mohammed
Hello Arun,
Thanks for you nice documentation and video.
I’m currently running my JBoss cluster using S3Ping configuration in AWS under Elastic Load Balencer, and this configuration is active-active and my application is not working as expected with this configuration and its more suitable with active-passive configuration, So I followed this documentation – https://docs.jboss.org/author/display/WFLY8/WildFly+8+Cluster+Howto , It’s worked for me except mod-cluster configuration.
As I mentioned above, running all the instances in AWS cloud, launch 3 instances
1. Domain controller and Master
2. Slave
3 Mod-cluster
Master-Slave configuration is working perfectly and mod-cluster configuration is not working for me.
1. In mod-cluster configuration, how will detect my master/slave instances, because there is no such configs in VirtualHost file.
2. Is this confiration will work in AWS infrastructure
Please advise me to configure this. thanks in advance.
Regards,
Jithin
Jithin,
This configuration should work. Can you post your question with complete details to WildFly forum at:
https://community.jboss.org/en/wildfly
Please include app server version and operating system.
Mohammed,
Are you getting this error on server-three or server-four ?
Arungupta,
Got error in server-four.
Arungupta,
please advise me to configure httpd.conf (apache side) configuration for your above video?
Thanks & Regards,
Mohammad
This is explained in detail at: https://docs.jboss.org/author/display/WFLY8/WildFly+8+Cluster+Howto
Hello Arungupta,
i have started two instances in standalone.xml by using below command,
./bin/standalone.sh -c standalone-ha.xml -Djboss.node.name=node1
and another instance start by same but with port offset
./bin/standalone.sh -c standalone-ha.xml -Djboss.socket.binding.port-offset=100 -Djboss.node.name=node2
i have configured my front end server (apache 2.4) by below configuration,
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
# Reverse Proxy
BalancerMember ajp://localhost:8009/ route=node1
BalancerMember ajp://localhost:8109/ route=node2
ProxySet lbmethod=byrequests
ProxySet failonstatus=404
ProxyPass / balancer://mybalancer/ stickysession=JSESSIONID|jsessionid
ProxyRequests Off
Order deny,allow
Deny from none
Allow from localhost
# Balancer-manager, for monitoring
SetHandler balancer-manager
Order deny,allow
Deny from none
Allow from none
it is working fine when we connect through the apache but if i stop node1 and restart it
i have got below warning
WARN [org.jgroups.protocols.TP$ProtocolAdapter] (INT-1,shared=udp) JGRP000031: node2/web: dropping unicast message to wrong destination 109fb003-b554-43f3-463f-183b82e95308
after that if i access the warfile through apache i have got an error like
ERROR [org.apache.jasper] (default task-1) JBWEB005015: The JSP container needs a valid work directory [E:\jboss_3\standalone\tmp\cluster-demo.war]
2014-06-24 12:31:10,318 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to //cluster-demo/index.jsp: org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
please help me to overcome from this issue..!
Thanks and Regards,
Mohammad
Mohammad,
Thanks for the detailed message. Can you post it to WildFly forum ?
https://community.jboss.org/en/wildfly
https://issues.jboss.org/browse/WFLY-2632
Hi Arungupta,
Thanks for your quick reply..! i have already posted in jboss forum too. but there is no solution for this issue.
Thanks & Regards,
Mohammad
Hi Arun
I followed your tech tip very closely. I now have a domain controller running 2 host (2 different machines). I Also used your test code that you provided. Every thing works on every host (which runs 2 servers each). Can you please tell me how to get the hosts to “talk” to each other? For example if I add info on host 1, how do I get Host two to show that info?
Thanks in advance
Hi Arun,
I configured wildfly in two system(master and slave) and able to control from center domain controller all the instances, but in my slave I am getting following exception
Server:server-four-slave] 06:32:05,826 ERROR [org.hornetq.core.server] (default I/O-1) HQ224018: Failed to create session: HornetQClusterSecurityException[errorType=CLUSTER_SECURITY_EXCEPTION message=HQ119099: Unable to authenticate cluster user: HORNETQ.CLUSTER.ADMIN.USER]
And session are not replicated in my slave instances but session replication is working properly in all instances of master host.. can you please suggest me whats going wrong do I need to do any special configuration?
Hi Arun,
Any idea or suggestion?
Can you post your question to WildFly form ? https://community.jboss.org/en/wildfly
Hello Arun,
This is a very good Article. I am involved in a project that requires setting up a HA using Wild Fly on multi nodes. The configuration should be Load Balancing and not just Fail-over.
Could you point out to any resource that could help me with this?
Regards,
Vivek Raman
Great video Arun! Very detailed and informative! That was cool how you showed the session data being failed over transparently. Does that easy failover also work for JEE websockets? If so, is there any additional configuration required to make that work? If not, is there a plan to make this work? I am just not sure if the websocket connection is considered part of the session data that gets failed over or if there are additional steps required.
Thanks in advance,
Fino
Fino,
Stay tuned for a blog on WebSocket connection failover, coming shortly. WebSocket clients have to reconnect on failure, and this would act as failover.
Hi Arun, Is there any information on how to use mod_cluster? Also is it possible to use failover with the CDI ViewScope? I’m seeing that the data is being lost when loading balancing between hosts. Any chance for a more realistic example?
Adrian,
Can you ask this question at WildFly forums ? https://developer.jboss.org/en/wildfly
Hi Arun,
we wanted to upgrade our JBoss7 servers to wildfly.
But we have problem during our “logout” action where we are invalidating the sessions.
While a long-running conversation is started and we are invalidating the session, we are getting exceptions and the WildFly server is completly blocked. We need to restart it.
Exception is always thrown with WildFly version 8.1 and 9.0alpha1.
Also the hudson build #1439 ip to #1449 are not working.
But using the HudsonBuild #1334, everything is working as expected.
We have already posted in the forums, but didn’t yet got an anwer:
https://developer.jboss.org/thread/249822
The forum post has a link to a demo war where we can reproduce the problem.
Thanks for any help,
Tom
Tom,
Let me check within the team and get back to you.
Tom,
Your question is now being answered in the forum.
Hi Arun,
I’m running one clustered active-active Jboss7 application in AWS using ELB(autoscaling) with S3Ping module, I want to upgrade Jboss7 to Wildfly8. S3Ping supports in Wildfly8 or is there any other way I can achieve this configuration ?
Regards,
Jithin