blob: 9fdaa0805f2898e273f98cac1ebc0717b01523f3 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Clustered Session Management: Hazelcast</title><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><meta name="keywords" content="jetty, servlet, servlet-api, cometd, http, websocket, eclipse, maven, java, server, software"><link rel="home" href="index.html" title="Jetty"><link rel="up" href="session-management.html" title="Chapter&nbsp;10.&nbsp;Session Management"><link rel="prev" href="session-clustering-infinispan.html" title="Session Clustering with Infinispan"><link rel="next" href="session-clustering-gcloud-datastore.html" title="Session Clustering with Google Cloud Datastore"><link xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" rel="shortcut icon" href="images/favicon.ico"><link rel="stylesheet" href="css/highlighter/foundation.css"><script src="js/highlight.pack.js"></script><script>
hljs.initHighlightingOnLoad();
</script><link type="text/css" rel="stylesheet" href="css/font-awesome/font-awesome.min.css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><tr><td style="width: 25%"><a href="http://www.eclipse.org/jetty"><img src="images/jetty-header-logo.png" alt="Jetty Logo"></a><br><span style="font-size: small">
Version: 9.3.28.v20191105</span></td><td style="width: 50%"></td></tr></table><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Clustered Session Management: Hazelcast</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="session-clustering-infinispan.html"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;10.&nbsp;Session Management<br><a accesskey="p" href="index.html"><i class="fa fa-home" aria-hidden="true"></i> Home</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="session-clustering-gcloud-datastore.html">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></td></tr></table><hr></div><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="jetty-callout"><h5 class="callout"><a href="http://www.webtide.com/">Contact the core Jetty developers at
<span class="website">www.webtide.com</span></a></h5><p>
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ...
scalability guidance for your apps and Ajax/Comet projects ... development services for sponsored feature development
</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="configuring-sessions-hazelcast"></a>Clustered Session Management: Hazelcast</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="configuring-sessions-hazelcast.html#_enabling_hazelcast_sessions">Enabling Hazelcast Sessions</a></span></dt><dt><span class="section"><a href="configuring-sessions-hazelcast.html#_configuring_hazelcast_remote_properties">Configuring Hazelcast Remote Properties</a></span></dt><dt><span class="section"><a href="configuring-sessions-hazelcast.html#_configuring_embedded_hazelcast_clustering">Configuring Embedded Hazelcast Clustering</a></span></dt><dt><span class="section"><a href="configuring-sessions-hazelcast.html#_configuring_hazelcast_embedded_properties">Configuring Hazelcast Embedded Properties</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_enabling_hazelcast_sessions"></a>Enabling Hazelcast Sessions</h3></div></div></div><p>When using the Jetty distribution, you will first need to enable the <code class="literal">session-store-hazelcast-remote</code> <a class="link" href="startup-modules.html" title="Managing Startup Modules">module</a> for your <a class="link" href="startup-base-and-home.html" title="Managing Jetty Base and Jetty Home">Jetty base</a> using the <code class="literal">--add-to-start</code> argument on the command line.</p><div class="screenexample"><pre class="screen">mb-olamy:tmp-base olamy$ java -jar ../start.jar --create-startd
MKDIR : ${jetty.base}/start.d
INFO : Base directory was modified
mb-olamy:tmp-base olamy$ java -jar ../start.jar --add-to-start=hazelcast-remote-sessions
ALERT: There are enabled module(s) with licenses.
The following 1 module(s):
+ contains software not provided by the Eclipse Foundation!
+ contains software not covered by the Eclipse Public License!
+ has not been audited for compliance with its license
Module: hazelcast-remote-sessions
+ Hazelcast is an open source project hosted on Github and released under the Apache 2.0 license.
+ https://hazelcast.org/
+ http://www.apache.org/licenses/LICENSE-2.0.html
Proceed (y/N)? y
INFO: hazelcast-remote-sessions initialised in ${jetty.base}/start.ini
COPY: /Users/olamy/repository/com/hazelcast/hazelcast-all/3.8.2/hazelcast-all-3.8.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-all-3.8.2.jar
COPY: /Users/olamy/repository/com/hazelcast/hazelcast-jetty9-sessionmanager/1.0.2/hazelcast-jetty9-sessionmanager-1.0.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-jetty9-sessionmanager-1.0.2.jar
COPY: /Users/olamy/repository/org/eclipse/jetty/jetty-nosql/9.3.21-SNAPSHOT/jetty-nosql-9.3.21-SNAPSHOT.jar to ${jetty.base}/lib/hazelcast/jetty-nosql-9.3.21-SNAPSHOT.jar
INFO: Base directory was modified</pre></div><p>Doing this enables the remote Hazelcast Session module and any dependent modules or files needed for it to run on the server.
The example above is using a fresh <code class="literal">${jetty.base}</code> with nothing else enabled.
Because Hazelcast is not a technology provided by the Eclipse Foundation, users are prompted to assent to the licenses of the external vendor (Apache in this case).</p><p>When the <code class="literal">--add-to-start</code> argument was added to the command line, it enabled the the <code class="literal">session-store-hazelcast-remote</code> module as well as the <code class="literal">sessions</code> and <code class="literal">server</code> modules, which are required for Hazelcast session management to operate.
It also downloaded the needed Hazelcast-specific jar files and created a directory named <code class="literal">${jetty.base}/lib/hazelcast/</code> to house them.</p><p>In addition to adding these modules to the classpath of the server it also added several ini configuration files to the <code class="literal">${jetty.base}/start.d</code> directory.</p><div class="blockquote"><blockquote class="blockquote"><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><i class="fa fa-asterisk" aria-hidden="true"></i> Note</h3><p>If you have updated versions of the jar files automatically downloaded by Jetty, you can place them in the associated <code class="literal">${jetty.base}/lib/</code> directory and use the <code class="literal">--skip-file-validation=&lt;module name&gt;</code> command line option to prevent errors when starting your server.</p></div></blockquote></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_configuring_hazelcast_remote_properties"></a>Configuring Hazelcast Remote Properties</h3></div></div></div><p>Opening the <code class="literal">start.ini</code> will show a list of all the configurable options for the Hazelcast module:</p><div class="screenexample"><pre class="screen"># ---------------------------------------
# Module: session-store-hazelcast-remote
--module=session-store-hazelcast-remote
#jetty.session.hazelcast.configurationLocation=</pre></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">jetty.session.hazelcast.configurationLocation</span></dt><dd>Path to an an Hazelcast xml configuration file</dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_configuring_embedded_hazelcast_clustering"></a>Configuring Embedded Hazelcast Clustering</h3></div></div></div><p>During testing, it can be helpful to run an in-process instance of Hazelcast.
To enable this you will first need to enable the <code class="literal">session-store-hazelcast-embedded</code> <a class="link" href="startup-modules.html" title="Managing Startup Modules">module</a> for your <a class="link" href="startup-base-and-home.html" title="Managing Jetty Base and Jetty Home">Jetty base</a> using the <code class="literal">--add-to-start</code> argument on the command line.</p><div class="screenexample"><pre class="screen">mb-olamy:tmp-base olamy$ java -jar ../start.jar --create-startd
MKDIR : ${jetty.base}/start.d
INFO : Base directory was modified
mb-olamy:tmp-base olamy$ java -jar ../start.jar --add-to-start=hazelcast-embedded-sessions
ALERT: There are enabled module(s) with licenses.
The following 1 module(s):
+ contains software not provided by the Eclipse Foundation!
+ contains software not covered by the Eclipse Public License!
+ has not been audited for compliance with its license
Module: hazelcast-embedded-sessions
+ Hazelcast is an open source project hosted on Github and released under the Apache 2.0 license.
+ https://hazelcast.org/
+ http://www.apache.org/licenses/LICENSE-2.0.html
Proceed (y/N)? y
INFO: hazelcast-embedded-sessions initialised in ${jetty.base}/start.ini
COPY: /Users/olamy/repository/com/hazelcast/hazelcast-all/3.8.2/hazelcast-all-3.8.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-all-3.8.2.jar
COPY: /Users/olamy/repository/com/hazelcast/hazelcast-jetty9-sessionmanager/1.0.2/hazelcast-jetty9-sessionmanager-1.0.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-jetty9-sessionmanager-1.0.2.jar
COPY: /Users/olamy/repository/org/eclipse/jetty/jetty-nosql/9.3.21-SNAPSHOT/jetty-nosql-9.3.21-SNAPSHOT.jar to ${jetty.base}/lib/hazelcast/jetty-nosql-9.3.21-SNAPSHOT.jar
INFO: Base directory was modified</pre></div><p>Doing this enables the embedded Hazelcast Session module and any dependent modules or files needed for it to run on the server.
The example above is using a fresh <code class="literal">${jetty.base}</code> with nothing else enabled.
Because Hazelcast is not a technology provided by the Eclipse Foundation, users are prompted to assent to the licenses of the external vendor (Apache in this case).</p><p>When the <code class="literal">--add-to-start</code> argument was added to the command line, it enabled the the <code class="literal">session-store-hazelcast-embedded</code> module as well as the <code class="literal">sessions</code> and <code class="literal">server</code> modules, which are required for Hazelcast session management to operate.
It also downloaded the needed Hazelcast-specific jar files and created a directory named <code class="literal">${jetty.base}/lib/hazelcast/</code> to house them.</p><p>In addition to adding these modules to the classpath of the server it also added several ini configuration files to the <code class="literal">${jetty.base}/start.d</code> directory.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_configuring_hazelcast_embedded_properties"></a>Configuring Hazelcast Embedded Properties</h3></div></div></div><p>Opening the <code class="literal">start.ini</code> will show a list of all the configurable options for the Hazelcast module:</p><div class="screenexample"><pre class="screen"># ---------------------------------------
# Module: hazelcast-embedded-sessions
--module=hazelcast-embedded-sessions
#jetty.session.hazelcast.configurationLocation=</pre></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">jetty.session.hazelcast.configurationLocation</span></dt><dd>Path to an an Hazelcast xml configuration file</dd></dl></div></div></div><script type="text/javascript">
SyntaxHighlighter.all()
</script><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="session-clustering-infinispan.html"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="session-management.html"><i class="fa fa-chevron-up" aria-hidden="true"></i> Top</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="session-clustering-gcloud-datastore.html">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></td></tr><tr><td width="40%" align="left" valign="top">Session Clustering with Infinispan&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html"><i class="fa fa-home" aria-hidden="true"></i> Home</a></td><td width="40%" align="right" valign="top">&nbsp;Session Clustering with Google Cloud Datastore</td></tr></table></div><p xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><div class="jetty-callout">
See an error or something missing?
<span class="callout"><a href="http://github.com/eclipse/jetty.project">Contribute to this documentation at
<span class="website"><i class="fa fa-github" aria-hidden="true"></i> Github!</span></a></span><span style="float: right"><i>(Generated: 2019-11-05)</i></span></div></p></body></html>