Glassfish Cluster"

From Documentation
m (correct highlight (via JWB))
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
{{ZKInstallationGuidePageHeader}}
 
{{ZKInstallationGuidePageHeader}}
  
<ref>  </ref>= Setup Glassfish Cluster environment
+
= Setup Glassfish Cluster environment =
  
 
Refer to this [http://weblogs.java.net/blog/amyroh/archive/2012/02/15/running-glassfish-312-apache-http-server blog] to set up glassfish cluster environment.
 
Refer to this [http://weblogs.java.net/blog/amyroh/archive/2012/02/15/running-glassfish-312-apache-http-server blog] to set up glassfish cluster environment.
Line 9: Line 9:
  
 
== web.xml ==
 
== web.xml ==
*Add the <tt>distributable</tt> element in <tt>WEB-INF/web.xml</tt>.
+
*Add the <code>distributable</code> element in <code>WEB-INF/web.xml</code>.
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0"?>
 
<?xml version="1.0"?>
Line 23: Line 23:
  
 
== sun-web.xml ==
 
== sun-web.xml ==
*Create <tt>sun-web.xml</tt> under projectName/WEB-INF folder to replicate session between cluster nodes.
+
*Create <code>sun-web.xml</code> under projectName/WEB-INF folder to replicate session between cluster nodes.
 
For example,
 
For example,
 
<source lang="xml">
 
<source lang="xml">

Latest revision as of 12:37, 19 January 2022




Setup Glassfish Cluster environment

Refer to this blog to set up glassfish cluster environment.

Additional setting in ZK project

You have to configure the following settings to make ZK project work in glassfish cluster environment.

web.xml

  • Add the distributable element in WEB-INF/web.xml.
<?xml version="1.0"?>
<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_2_5.xsd"
    version="2.5">
    
    <distributable/>

</web-app>

sun-web.xml

  • Create sun-web.xml under projectName/WEB-INF folder to replicate session between cluster nodes.

For example,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Servlet 3.0//EN" 
        "http://www.sun.com/software/appserver/dtds/sun-web-app_3_0-0.dtd">
<sun-web-app>
    <context-root>projectName</context-root>
    <session-config>
        <session-manager persistence-type="replicated">
            <manager-properties>
                <property name="persitencerequency" value="web-method" />
            </manager-properties>
            <store-properties>
                <property name="persistenceScope" value="session" />
            </store-properties>
        </session-manager>
    </session-config>
</sun-web-app>

Version History

Last Update : 2022/01/19



Last Update : 2022/01/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.