Glassfish Cluster"
From Documentation
m (correct highlight (via JWB)) |
|||
(3 intermediate revisions by one other user not shown) | |||
Line 2: | Line 2: | ||
= 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. | ||
= Additional setting in ZK project = | = Additional setting in ZK project = | ||
Line 8: | Line 9: | ||
== web.xml == | == web.xml == | ||
− | *Add the < | + | *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 22: | Line 23: | ||
== sun-web.xml == | == sun-web.xml == | ||
− | *Create < | + | *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 inWEB-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