blob: dfb1e06059af374ebe0f7ad6c8e4a806a774d57d [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Session Clustering with Google Cloud Datastore</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="configuring-sessions-hazelcast.html" title="Clustered Session Management: Hazelcast"><link rel="next" href="configuring-logging.html" title="Chapter&nbsp;11.&nbsp;Jetty Logging"><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">Session Clustering with Google Cloud Datastore</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="configuring-sessions-hazelcast.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="configuring-logging.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="session-clustering-gcloud-datastore"></a>Session Clustering with Google Cloud Datastore</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="session-clustering-gcloud-datastore.html#_configuration_4">Configuration</a></span></dt><dt><span class="section"><a href="session-clustering-gcloud-datastore.html#_the_gcloud_sessions_module">The gcloud-sessions Module</a></span></dt></dl></div><p>Jetty can support session clustering by persisting sessions to <a class="link" href="https://cloud.google.com/datastore/docs/concepts/overview" target="_top">Google Cloud Datastore</a>.
Each Jetty instance locally caches sessions for which it has received requests, writing any changes to the session through to the Datastore as the request exits the server.
Sessions must obey the Serialization contract, and servlets must call the <code class="literal">Session.setAttribute()</code> method to ensure that changes are persisted.</p><p>The persistent session mechanism works in conjunction with a load balancer that supports stickiness.
Stickiness can be based on various data items, such as source IP address or characteristics of the session ID or a load-balancer specific mechanism.
For those load balancers that examine the session ID, the Jetty persistent session mechanism appends a node ID to the session ID, which can be used for routing.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_configuration_4"></a>Configuration</h3></div></div></div><p>There are two components to session management in Jetty: a session ID manager and a session manager.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">The session ID manager ensures that session IDs are unique across all webapps hosted on a Jetty instance, and thus there can only be one session ID manager per Jetty instance.</li><li class="listitem">The session manager handles the session lifecycle (create/update/invalidate/expire) on behalf of a web application, so there is one session manager per web application instance.</li></ul></div><p>These managers also cooperate and collaborate with the <code class="literal">org.eclipse.jetty.server.session.SessionHandler</code> to enable cross-context dispatch.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_the_gcloud_sessions_module"></a>The gcloud-sessions Module</h3></div></div></div><p>When using the jetty distribution, to enable Cloud Datastore session persistence, you will first need to enable the <code class="literal">gcloud-sessions</code> <a class="link" href="startup-modules.html" title="Managing Startup Modules">module</a> for your <a class="link" href="quickstart-running-jetty.html#creating-jetty-base" title="Creating a new Jetty Base">base</a> using the <code class="literal">--add-to-start</code> or <code class="literal">--add-to-startd</code> argument to the <a class="link" href="startup.html#startup-overview" title="Startup Overview">start.jar</a>.</p><p>As part of the module installation, the necessary jars will be dynamically downloaded and installed to your <code class="literal">${jetty.base}/lib/gcloud</code> directory.
If you need to up or downgrade the version of the jars, then you can delete the jars that were automatically installed and replace them.
Once you&#8217;ve done that, you will need to prevent jetty&#8217;s startup checks from detecting the missing jars.
To do that, you can use <code class="literal">--skip-file-validation=glcoud-sessions</code> argument to start.jar on the command line, or place that line inside <code class="literal">${jetty.base}/start.ini</code> to ensure it is used for every start.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_configuring_the_gcloudsessionidmanager"></a>Configuring the GCloudSessionIdManager</h4></div></div></div><p>The gcloud-sessions module will have installed file called <code class="literal">${jetty.home}/etc/jetty-gcloud-sessions.xml</code>.
This file configures an instance of the <code class="literal">GCloudSessionIdManager</code> that will be shared across all webapps deployed on that server. It looks like this:</p><pre 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"><code>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"&gt;
&lt;Configure id="Server" class="org.eclipse.jetty.server.Server"&gt;
&lt;!-- ===================================================================== --&gt;
&lt;!-- Configure the Deployer to create a GCloudSessionManager for every --&gt;
&lt;!-- webapp that is deployed --&gt;
&lt;!-- ===================================================================== --&gt;
&lt;Ref id="DeploymentManager"&gt;
&lt;!-- Add a customize step to the deployment lifecycle --&gt;
&lt;Call name="insertLifeCycleNode"&gt;
&lt;Arg&gt;deployed&lt;/Arg&gt;
&lt;Arg&gt;starting&lt;/Arg&gt;
&lt;Arg&gt;customise&lt;/Arg&gt;
&lt;/Call&gt;
&lt;Call name="addLifeCycleBinding"&gt;
&lt;Arg&gt;
&lt;New class="org.eclipse.jetty.deploy.bindings.GlobalWebappConfigBinding"&gt;
&lt;Set name="jettyXml"&gt;&lt;Property name="jetty.home" default="."/&gt;/etc/gcloud-session-context.xml&lt;/Set&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/Call&gt;
&lt;/Ref&gt;
&lt;/Configure&gt;</code></pre><p>You configure it by setting values for properties.
The properties will either be inserted as commented out in your <code class="literal">start.ini</code>, or your <code class="literal">start.d/gcloud-sessions.ini</code> file, depending on how you enabled the module.</p><p>The only property you always need to set is the name of the node in the cluster:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">jetty.gcloudSession.workerName</span></dt><dd>The name that uniquely identifies this node in the cluster.
This value will also be used by the sticky load balancer to identify the node.
Don&#8217;t forget to change the value of this property on <span class="strong"><strong>each</strong></span> node on which you enable gcloud datastore session clustering.</dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_configuring_gcloud_datastore"></a>Configuring GCloud Datastore</h4></div></div></div><p>Things that you will need:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">a local installation of the <a class="link" href="https://cloud.google.com/sdk/" target="_top">Google Cloud SDK</a></li><li class="listitem">a project id referred to below as [YOUR PROJECT ID]</li><li class="listitem">to have <a class="link" href="https://cloud.google.com/datastore/docs/activate" target="_top">enabled your project id</a> to use GCloud Datastore</li></ul></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_using_gcloud_datastore_from_compute_appengine"></a>Using GCloud Datastore from Compute/AppEngine</h5></div></div></div><p>If you are running your webapp from within ComputeEngine or AppEngine, you do not need to do anything else in order to configure your GCloud setup. All necessary information will be inferred from the environment by the infrastrcture.</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_using_gcloud_datastore_from_an_external_server"></a>Using GCloud Datastore from an external server</h5></div></div></div><p>If you are running your webapp externally to Google infrastructure, you can still interact with the remote GCloud Datastore service.</p><p>Execute the following commands:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">gcloud config set project [YOUR PROJECT ID].</li><li class="listitem">gcloud auth login</li></ul></div><p>This will populate your environment with the necessary authentication information to allow you to contact the remote GCloud Datastore instance.</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_using_gcloud_datastore_local_development_server"></a>Using GCloud Datastore local development server</h5></div></div></div><p>If you would like to locally test your application, you can use the Google Cloud SDK&#8217;s <a class="link" href="https://cloud.google.com/datastore/docs/tools/datastore-emulator" target="_top">GCloud Datastore emulator</a>.</p><p>Follow the instructions on the <a class="link" href="https://cloud.google.com/datastore/docs/tools/datastore-emulator" target="_top">GCloud Datastore emulator page</a> to set up your environment.</p></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_configuring_the_gcloudsessionmanager"></a>Configuring the GCloudSessionManager</h4></div></div></div><p>As mentioned elsewhere, there must be one <code class="literal">SessionManager</code> per context (e.g. webapp).
Each SessionManager needs to reference the single <code class="literal">GCloudSessionIdManager</code>.</p><p>The way you configure a <code class="literal">GCloudSessionManager</code> depends on whether you&#8217;re configuring from a context xml file, a <code class="literal">jetty-web.xml</code> file or code.
The basic difference is how you get a reference to the Jetty <code class="literal">org.eclipse.jetty.server.Server</code> instance.</p><p>From a context xml file, you reference the Server instance as a Ref:</p><pre 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"><code> &lt;!-- Get a reference to the GCloudSessionIdManager --&gt;
&lt;Ref id="Server"&gt;
&lt;Call id="idMgr" name="getSessionIdManager"/&gt;
&lt;/Ref&gt;
&lt;!-- Use the GCloudSessionIdManager to set up the GCloudSessionManager --&gt;
&lt;Set name="sessionHandler"&gt;
&lt;New class="org.eclipse.jetty.server.session.SessionHandler"&gt;
&lt;Arg&gt;
&lt;New id="mgr" class="org.eclipse.jetty.gcloud.session.GCloudSessionManager"&gt;
&lt;Set name="sessionIdManager"&gt;
&lt;Ref id="idMgr"/&gt;
&lt;/Set&gt;
&lt;Set name="scavengeIntervalSec"&gt;600&lt;/Set&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/New&gt;
&lt;/Set&gt;</code></pre><p>From a <code class="literal">WEB-INF/jetty-web.xml</code> file, you can reference the Server instance directly:</p><pre 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"><code>&lt;!-- Reference the server directly --&gt;
&lt;Get name="server"&gt;
&lt;Get id="idMgr" name="sessionIdManager"/&gt;
&lt;/Get&gt;
&lt;!-- Apply the SessionIdManager to the GCloudSessionManager --&gt;
&lt;Set name="sessionHandler"&gt;
&lt;New class="org.eclipse.jetty.server.session.SessionHandler"&gt;
&lt;Arg&gt;
&lt;New id="mgr" class="org.eclipse.jetty.gcloud.session.GCloudSessionManager"&gt;
&lt;Set name="sessionIdManager"&gt;
&lt;Ref id="idMgr"/&gt;
&lt;/Set&gt;
&lt;Set name="scavengeIntervalSec"&gt;600&lt;/Set&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/New&gt;
&lt;/Set&gt;</code></pre><p>The <code class="literal">GCloudSessionManager</code> supports the following configuration setters:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">scavengeIntervalSec</span></dt><dd>Time in seconds between runs of a scavenger task that looks for expired old sessions to delete.
The default is 10 minutes.
If set to 0, no scavenging is done.</dd><dt><span class="term">staleIntervalSec</span></dt><dd>The length of time a session can be in memory without being checked against the cluster.
A value of 0 indicates that the session is never checked against the cluster - the current node is considered to be the master for the session.</dd><dt><span class="term">maxQueryResults</span></dt><dd>The maximum number of results to return for a query to find expired sessions.
For efficiency it is important to limit the size of the result.
The default is 100.
If 0 or negative numbers are set, the default is used instead.</dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_the_gcloud_memcached_sessions_module"></a>The gcloud-memcached-sessions module</h4></div></div></div><p>As an optimization, you can have Jetty store your session data into GCloud Datastore but also cache it into memcached. This serves two purposes: faster read-accesses and also better support for non-sticky load balancers (although using a non-sticky load balancer is highly undesirable and not recommended).</p><p>You will need to enable the <code class="literal">gcloud-memcached-sessions</code> <a class="link" href="startup-modules.html" title="Managing Startup Modules">module</a> for your <a class="link" href="quickstart-running-jetty.html#creating-jetty-base" title="Creating a new Jetty Base">base</a> using the <code class="literal">--add-to-start</code> or <code class="literal">--add-to-startd</code> argument to the <a class="link" href="startup.html#startup-overview" title="Startup Overview">start.jar</a>.</p><p>If you already enabled the gcloud-sessions module, that&#8217;s fine as the gcloud-memcached-sessions module depends on it anyway.</p><p>Jetty uses the <a class="link" href="https://github.com/killme2008/xmemcached" target="_top">Xmemcached</a> java client.
It depends on <a class="link" href="http://www.slf4j.org/" target="_top">slf4j</a>, so you will need to choose an <a class="link" href="http://www.slf4j.org/" target="_top">slf4j logging implementation</a>. You can copy the chosen implementation jars into your $jetty.base/lib/ext directory.</p><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_configuring_the_gcloudsessionidmanager_2"></a>Configuring the GCloudSessionIdManager</h5></div></div></div><p>The instructions here are exactly the same as for the gcloud-sessions module.</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_configuring_gcloud_datastore_2"></a>Configuring GCloud Datastore</h5></div></div></div><p>The instructions here are exactly the same as for the gcloud-sessions module.</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_configuring_memcached"></a>Configuring Memcached</h5></div></div></div><p>If you have installed memcached on a host and port other than the defaults of <code class="literal">localhost</code> and <code class="literal">11211</code>, then you will need to take note of these values and supply them to the configuration of the <code class="literal">GCloudMemcachedSessionManager</code>.</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_configuring_the_gcloudmemcachedsessionmanager"></a>Configuring the GCloudMemcachedSessionManager</h5></div></div></div><p><span class="strong"><strong>Note that</strong></span> you will be configuring a <code class="literal">GCloudMemcachedSessionManager</code> <span class="emphasis"><em>instead of</em></span> a <code class="literal">GCloudSessionManager</code>.</p><p>As usual, there must be only one per context (e.g. webapp).
Each GCloudMemcachedSessionManager needs to reference the single <code class="literal">GCloudSessionIdManager</code>.</p><p>The way you configure a <code class="literal">GCloudMemcachedSessionManager</code> depends on whether you&#8217;re configuring from a context xml file, a <code class="literal">jetty-web.xml</code> file or code.
The basic difference is how you get a reference to the Jetty <code class="literal">org.eclipse.jetty.server.Server</code> instance.</p><p>From a context xml file, you reference the Server instance as a Ref:</p><pre 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"><code> &lt;!-- Get a reference to the GCloudSessionIdManager --&gt;
&lt;Ref id="Server"&gt;
&lt;Call id="idMgr" name="getSessionIdManager"/&gt;
&lt;/Ref&gt;
&lt;!-- Use the GCloudSessionIdManager to set up the GCloudMemcachedSessionManager --&gt;
&lt;Set name="sessionHandler"&gt;
&lt;New class="org.eclipse.jetty.server.session.SessionHandler"&gt;
&lt;Arg&gt;
&lt;New id="mgr" class="org.eclipse.jetty.gcloud.memcached.session.GCloudMemcachedSessionManager"&gt;
&lt;Set name="sessionIdManager"&gt;
&lt;Ref id="idMgr"/&gt;
&lt;/Set&gt;
&lt;Set name="scavengeIntervalSec"&gt;600&lt;/Set&gt;
&lt;Set name="host"&gt;myhost&lt;/Set&gt;
&lt;Set name="port"&gt;11211&lt;/Set&gt;
&lt;Set name="expirySec"&gt;0&lt;/Set&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/New&gt;
&lt;/Set&gt;</code></pre><p>From a <code class="literal">WEB-INF/jetty-web.xml</code> file, you can reference the Server instance directly:</p><pre 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"><code>&lt;!-- Reference the server directly --&gt;
&lt;Get name="server"&gt;
&lt;Get id="idMgr" name="sessionIdManager"/&gt;
&lt;/Get&gt;
&lt;!-- Apply the SessionIdManager to the GCloudMemcachedSessionManager --&gt;
&lt;Set name="sessionHandler"&gt;
&lt;New class="org.eclipse.jetty.server.session.SessionHandler"&gt;
&lt;Arg&gt;
&lt;New id="mgr" class="org.eclipse.jetty.gcloud..memcached.session.GCloudMemcachedSessionManager"&gt;
&lt;Set name="sessionIdManager"&gt;
&lt;Ref id="idMgr"/&gt;
&lt;/Set&gt;
&lt;Set name="scavengeIntervalSec"&gt;600&lt;/Set&gt;
&lt;Set name="host"&gt;myhost&lt;/Set&gt;
&lt;Set name="port"&gt;11211&lt;/Set&gt;
&lt;Set name="expirySec"&gt;0&lt;/Set&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/New&gt;
&lt;/Set&gt;</code></pre><p>The <code class="literal">GCloudMemcachedSessionManager</code> supports the following configuration setters:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">scavengeIntervalSec</span></dt><dd>Time in seconds between runs of a scavenger task that looks for expired old sessions to delete.
The default is 10 minutes.
If set to 0, no scavenging is done.</dd><dt><span class="term">staleIntervalSec</span></dt><dd>The length of time a session can be in memory without being checked against the cluster.
A value of 0 indicates that the session is never checked against the cluster - the current node is considered to be the master for the session.</dd><dt><span class="term">maxQueryResults</span></dt><dd>The maximum number of results to return for a query to find expired sessions.
For efficiency it is important to limit the size of the result.
The default is 100.
If 0 or negative numbers are set, the default is used instead.</dd><dt><span class="term">host</span></dt><dd>The address of the host where the memcached server is running. Defaults to "localhost".</dd><dt><span class="term">port</span></dt><dd>The port on the host where the memcached serer is running. Defaults to "11211".</dd><dt><span class="term">expirySec</span></dt><dd>The time in seconds that an entry in the memcached cache is considered valid. By default, entries are are not aged out of the cached, however they may be evicted due to memory constraints.</dd></dl></div></div></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="configuring-sessions-hazelcast.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="configuring-logging.html">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></td></tr><tr><td width="40%" align="left" valign="top">Clustered Session Management: Hazelcast&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;Chapter&nbsp;11.&nbsp;Jetty Logging</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>