Session replication not working in glassfish on multi node cluster

风流意气都作罢 提交于 2019-12-11 03:06:21

问题


Session replication not working in glassfish on multi node cluster

1) application contains distributable tag in web.xml 2) application when deployed in cluster c1, which contains 2 instances present on same node, session replication works. 3) Same application when deployed in cluster c2, which contains 2 instances present on two CentOS machines, session replication does not works.

Following are content of glassfish-web.xml (if required for reference) :

<glassfish-web-app error-url="">
    <session-config>
        <session-manager persistence-type="replicated">
            <manager-properties>
                <property name="persistenceFrequency" value="web-method" />
                <property name="relaxCacheVersionSemantics" value="true"/>
            </manager-properties>
            <store-properties>
                <property name="persistenceScope" value="session" />
            </store-properties>
        </session-manager>
        <!--<cookie-properties>
        <property name="cookieDomain" value="node2"/>
        <property name="cookieDomain" value="node4"/>
        </cookie-properties> -->
        <cache max-entries="4096" timeout-in-seconds="30" enabled="false">
            <default-helper/>
        </cache>
    </session-config>
    <context-root>/contextNaam</context-root> 
    <class-loader delegate="true"/>
    <resource-ref>
        <res-ref-name>jdbc/safe</res-ref-name>
        <jndi-name>jdbc/safe</jndi-name>
    </resource-ref>
    <jsp-config>
        <property name="keepgenerated" value="true">
            <description>Keep a copy of the generated servlet class' java code.</description>
        </property>
    </jsp-config>
</glassfish-web-app>  

Edit : 1) Does not seems to be a UDP communication issue between 2 centos machines. 2) Tried to create tcp-cluster as mentioned in HA-administration-guide also, but still same effect, session not replicated on tcpcluster.


回答1:


There was a bug in Shoal and incompatibility with Grizzly. I have fixed it in Payara and the fix is now in Glassfish too. Current state is that it seems it works (Payara 4.1.1.154).




回答2:


Under CentOS, you might run into trouble with SELinux and firewall rules. I suggest you disable them and try again.

I had a similar issue, though using JBoss, not Glassfish.

E.



来源:https://stackoverflow.com/questions/28062516/session-replication-not-working-in-glassfish-on-multi-node-cluster

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!