2
我試圖讓我的JSF Web應用程序部署在具有兩個節點的「域」羣集中。JBoss EAP 6.1中的HTTP會話複製
我無法獲得節點之間複製的HTTP會話。
我已經配置我的的web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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">
<session-config>
<session-timeout>30</session-timeout>
<tracking-mode>URL</tracking-mode>
</session-config>
<distributable></distributable>
</web-app>
和的jboss-web.xml中
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>thumbzup-admin</context-root>
<!--replication-config>
<replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>
<replication-granularity>SESSION</replication-granularity>
</replication-config-->
<replication-config>
<cache-name>custom-session-cache</cache-name>
<replication-trigger>SET</replication-trigger>
<replication-granularity>ATTRIBUTE</replication-granularity>
<!--replication-field-batch-mode>true</replication-field-batch-mode-->
<use-jk>false</use-jk>
<max-unreplicated-interval>30</max-unreplicated-interval>
<snapshot-mode>INSTANT</snapshot-mode>
<snapshot-interval>1000</snapshot-interval>
<replication-mode>SYNCHRONOUS</replication-mode>
<!--session-notification-policy>com.example.CustomSessionNotificationPolicy</session-notification-policy-->
</replication-config>
</jboss-web>
和Infinispan的緩存容器中domain.xml中;
<cache-container name="web" aliases="standard-session-cache" default-cache="repl" module="org.jboss.as.clustering.web.infinispan">
<transport lock-timeout="60000"/>
<replicated-cache name="repl" mode="ASYNC" batching="true">
<file-store/>
</replicated-cache>
<replicated-cache name="sso" mode="SYNC" batching="true"/>
<distributed-cache name="dist" l1-lifespan="0" mode="ASYNC" batching="true">
<file-store/>
</distributed-cache>
</cache-container>
但是,當NODE2上使用相同的SESSIONID時,我無法檢索在NODE1上創建的會話。
有什麼建議嗎?