Wildfly8.2 SSO Cluster replication
vamshi_appala Oct 5, 2015 2:31 PMHello,
I have setup an Wildfly cluster with two instances and with Apache Mod cluster acting as load balancer. I have deployed same applications on both the cluster Nodes. Our webapps have been configured to Use Web SSO.
Here is the scenario where I am seeing issues
1) Login to Web Application, load balancer choose one particular server [ Server A]
2) Logged in, I can see JSessionID and JSessionIDSSO
3)Now I shut down the Server A after some activity
4)Load Balancer is automatically re-directing the request to Server B
5)When I look at the browser Cookies I see JSessionIDSSO is set to NULL and my apps doesnt work properly because of missing SSO token
Here is my Wildfly Configuration
<subsystem xmlns="urn:jboss:domain:undertow:1.2" instance-id="${jboss.node.name}">
<buffer-cache name="default"/>
<server name="default-server">
<ajp-listener name="ajp" socket-binding="ajp"/>
<http-listener name="default" socket-binding="http" max-header-size="1073741824" max-post-size="1073741824"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
<single-sign-on path="/"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="server-header" header-name="Server" header-value="WildFly/8"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
</filters>
</subsystem>
<subsystem xmlns="urn:jboss:domain:infinispan:2.0">
<cache-container name="server" default-cache="default" module="org.wildfly.clustering.server" aliases="singleton cluster">
<transport lock-timeout="60000"/>
<replicated-cache name="default" batching="true" mode="SYNC">
<locking isolation="REPEATABLE_READ"/>
</replicated-cache>
</cache-container>
<cache-container name="web" default-cache="repl" module="org.wildfly.clustering.web.infinispan" aliases="standard-session-cache">
<transport lock-timeout="60000"/>
<replicated-cache name="repl" batching="true" mode="ASYNC">
<file-store/>
</replicated-cache>
<replicated-cache name="sso" batching="true" mode="SYNC"/>
<distributed-cache name="dist" batching="true" mode="ASYNC" l1-lifespan="0">
<file-store/>
</distributed-cache>
</cache-container>
Following are the configuration options I have defined in web.xml and jboss-web.xml
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<distributable/>
</web-app>
jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain>Login</security-domain>
<context-root>/portal</context-root>
<replication-config>
<replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>
<replication-granularity>SESSION</replication-granularity>
</replication-config>
</jboss-web>