Further updates to Sessions documentation
Signed-off-by: WalkerWatch <ctwalker@gmail.com>
This commit is contained in:
parent
7f032417db
commit
cdb86f810d
|
@ -16,7 +16,7 @@
|
|||
|
||||
[[configuring-sessions-file-system]]
|
||||
|
||||
=== Configuring Session Management using the File System
|
||||
=== Non-Clustered Session Management: File System
|
||||
|
||||
When using the Jetty distribution, you will first need to enable the `session-store-file` link:#startup-modules[module] for your link:#startup-base-and-home[Jetty base] using the `--add-to-start` argument on the command line.
|
||||
|
||||
|
@ -52,12 +52,12 @@ Opening the `start.d/session-store-file.ini` will show a list of all the configu
|
|||
# ---------------------------------------
|
||||
--module=session-store-file
|
||||
|
||||
jetty.session.storeDir=${jetty.base}/sessions
|
||||
#jetty.session.deleteUnrestorableFiles=false
|
||||
jetty.session.file.storeDir=${jetty.base}/sessions
|
||||
#jetty.session.file.deleteUnrestorableFiles=false
|
||||
----
|
||||
|
||||
jetty.session.storeDir::
|
||||
This defines the location for storage of Session files.
|
||||
jetty.session.deleteUnrestorableFiles::
|
||||
jetty.session.file.deleteUnrestorableFiles::
|
||||
Boolean.
|
||||
If set to true, unreadable files will be deleted: this is useful to prevent repeated logging of the same error when the scavenger periodically (re-) attempts to load the corrupted information for a session in order to expire it.
|
||||
|
|
|
@ -1,141 +0,0 @@
|
|||
// ========================================================================
|
||||
// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
|
||||
// ========================================================================
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
|
||||
=== Configuring the Google Cloud DataStore Module
|
||||
|
||||
When using the Jetty distribution, you will first need to enable the `session-store-gcloud` link:#startup-modules[module] for your link:#startup-base-and-home[Jetty base] using the `--add-to-start` argument on the command line.
|
||||
|
||||
|
||||
[source, screen, subs="{sub-order}"]
|
||||
----
|
||||
$ java -jar ../start.jar --create-startd
|
||||
INFO : Base directory was modified
|
||||
|
||||
$ java -jar ../start.jar --add-to-start=session-store-gcloud
|
||||
|
||||
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: session-store-gcloud
|
||||
+ GCloudDatastore is an open source project hosted on Github and released under the Apache 2.0 license.
|
||||
+ https://github.com/GoogleCloudPlatform/gcloud-java
|
||||
+ http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
Proceed (y/N)? y
|
||||
INFO : server initialised (transitively) in ${jetty.base}/start.d/server.ini
|
||||
INFO : sessions initialised (transitively) in ${jetty.base}/start.d/sessions.ini
|
||||
INFO : session-store-gcloud initialised in ${jetty.base}/start.d/session-store-gcloud.ini
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/cloud/gcloud-java-datastore/0.2.3/gcloud-java-datastore-0.2.3.jar to ${jetty.base}/lib/gcloud/gcloud-java-datastore-0.2.3.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/cloud/gcloud-java-core/0.2.3/gcloud-java-core-0.2.3.jar to ${jetty.base}/lib/gcloud/gcloud-java-core-0.2.3.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/auth/google-auth-library-credentials/0.3.1/google-auth-library-credentials-0.3.1.jar to ${jetty.base}/lib/gcloud/google-auth-library-credentials-0.3.1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/0.3.1/google-auth-library-oauth2-http-0.3.1.jar to ${jetty.base}/lib/gcloud/google-auth-library-oauth2-http-0.3.1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client-jackson2/1.19.0/google-http-client-jackson2-1.19.0.jar to ${jetty.base}/lib/gcloud/google-http-client-jackson2-1.19.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.1.3/jackson-core-2.1.3.jar to ${jetty.base}/lib/gcloud/jackson-core-2.1.3.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client/1.21.0/google-http-client-1.21.0.jar to ${jetty.base}/lib/gcloud/google-http-client-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar to ${jetty.base}/lib/gcloud/jsr305-1.3.9.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar to ${jetty.base}/lib/gcloud/httpclient-4.0.1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar to ${jetty.base}/lib/gcloud/httpcore-4.0.1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/commons-codec/commons-codec/1.3/commons-codec-1.3.jar to ${jetty.base}/lib/gcloud/commons-codec-1.3.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/oauth-client/google-oauth-client/1.21.0/google-oauth-client-1.21.0.jar to ${jetty.base}/lib/gcloud/google-oauth-client-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/guava/guava/19.0/guava-19.0.jar to ${jetty.base}/lib/gcloud/guava-19.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/api-client/google-api-client-appengine/1.21.0/google-api-client-appengine-1.21.0.jar to ${jetty.base}/lib/gcloud/google-api-client-appengine-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/oauth-client/google-oauth-client-appengine/1.21.0/google-oauth-client-appengine-1.21.0.jar to ${jetty.base}/lib/gcloud/google-oauth-client-appengine-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/oauth-client/google-oauth-client-servlet/1.21.0/google-oauth-client-servlet-1.21.0.jar to ${jetty.base}/lib/gcloud/google-oauth-client-servlet-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client-jdo/1.21.0/google-http-client-jdo-1.21.0.jar to ${jetty.base}/lib/gcloud/google-http-client-jdo-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/api-client/google-api-client-servlet/1.21.0/google-api-client-servlet-1.21.0.jar to ${jetty.base}/lib/gcloud/google-api-client-servlet-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/javax/jdo/jdo2-api/2.3-eb/jdo2-api-2.3-eb.jar to ${jetty.base}/lib/gcloud/jdo2-api-2.3-eb.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/javax/transaction/transaction-api/1.1/transaction-api-1.1.jar to ${jetty.base}/lib/gcloud/transaction-api-1.1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client-appengine/1.21.0/google-http-client-appengine-1.21.0.jar to ${jetty.base}/lib/gcloud/google-http-client-appengine-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client-jackson/1.21.0/google-http-client-jackson-1.21.0.jar to ${jetty.base}/lib/gcloud/google-http-client-jackson-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/org/codehaus/jackson/jackson-core-asl/1.9.11/jackson-core-asl-1.9.11.jar to ${jetty.base}/lib/gcloud/jackson-core-asl-1.9.11.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/joda-time/joda-time/2.9.2/joda-time-2.9.2.jar to ${jetty.base}/lib/gcloud/joda-time-2.9.2.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/org/json/json/20151123/json-20151123.jar to ${jetty.base}/lib/gcloud/json-20151123.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/cloud/datastore/datastore-v1beta3-protos/1.0.0-beta/datastore-v1beta3-protos-1.0.0-beta.jar to ${jetty.base}/lib/gcloud/datastore-v1beta3-protos-1.0.0-beta.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/protobuf/protobuf-java/3.0.0-beta-1/protobuf-java-3.0.0-beta-1.jar to ${jetty.base}/lib/gcloud/protobuf-java-3.0.0-beta-1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/cloud/datastore/datastore-v1beta3-proto-client/1.0.0-beta.2/datastore-v1beta3-proto-client-1.0.0-beta.2.jar to ${jetty.base}/lib/gcloud/datastore-v1beta3-proto-client-1.0.0-beta.2.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client-protobuf/1.20.0/google-http-client-protobuf-1.20.0.jar to ${jetty.base}/lib/gcloud/google-http-client-protobuf-1.20.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/api-client/google-api-client/1.20.0/google-api-client-1.20.0.jar to ${jetty.base}/lib/gcloud/google-api-client-1.20.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/guava/guava-jdk5/13.0/guava-jdk5-13.0.jar to ${jetty.base}/lib/gcloud/guava-jdk5-13.0.jar
|
||||
INFO : Base directory was modified
|
||||
WARN : Module session-store-gcloud requires jcl-impl from one of [jcl, jcl-slf4j]
|
||||
|
||||
WARN : Module session-store-gcloud requires jcl-api from one of [jcl, jcl-slf4j]
|
||||
|
||||
WARN : Unsatisfied module dependencies: session-store-gcloud,session-store-gcloud
|
||||
|
||||
Usage: java -jar $JETTY_HOME/start.jar [options] [properties] [configs]
|
||||
java -jar $JETTY_HOME/start.jar --help # for more information
|
||||
----
|
||||
|
||||
Doing this enables the GCloud Session module and any dependent session modules or files needed for it to run on the server.
|
||||
The example above is running an fresh `${jetty.base}` with nothing enabled.
|
||||
Because the Google Cloud DataStore 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).
|
||||
You will notice, however, that the above output presented a warning: GCloud requires certain Java Commons Logging features to work correctly.
|
||||
As such, you will also need to enable either the `jcl` or `jcl-slf4j` module.
|
||||
|
||||
[source, screen, subs="{sub-order}"]
|
||||
----
|
||||
$ java -jar ../start.jar --add-to-start=jcl
|
||||
|
||||
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: jcl
|
||||
+ Log4j is released under the Apache 2.0 license.
|
||||
+ http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
Proceed (y/N)? y
|
||||
INFO : jcl initialised in ${jetty.base}/start.d/jcl.ini
|
||||
DOWNLOAD: http://central.maven.org/maven2/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar to ${jetty.base}/lib/jcl/commons-logging-1.1.3.jar
|
||||
INFO : Base directory was modified
|
||||
----
|
||||
|
||||
When the `--add-to-start` argument was added to the command line the first time, it enabled the the `session-store-gcloud` module as well as the `sessions` and `server` modules, which are required for GCloud session management to operate; the `jcl` module was added when we ran it the second time.
|
||||
In addition to adding these modules to the classpath of the server it also added several ini configuration files to the `start.d` directory of the `${jetty.base}`.
|
||||
|
||||
____
|
||||
[NOTE]
|
||||
If you have updated versions of the jar files automatically downloaded by Jetty, you can place them in the associated `${jetty.base}/lib/` directory and use the `--skip-file-validation=<module name>` command line option to prevent errors when starting your server.
|
||||
____
|
||||
|
||||
Opening the `start.d/session-store-gcloud.ini` will show a list of all the configurable options for the Google Cloud DataStore module:
|
||||
|
||||
[source, screen, subs="{sub-order}"]
|
||||
----
|
||||
# ---------------------------------------
|
||||
# Module: session-store-gcloud
|
||||
# Enables GCloudDatastore session management.
|
||||
# ---------------------------------------
|
||||
--module=session-store-gcloud
|
||||
|
||||
|
||||
## GCloudDatastore Session config
|
||||
#jetty.gcloudSession.maxRetries=5
|
||||
#jetty.gcloudSession.backoffMs=1000
|
||||
----
|
||||
|
||||
jetty.gcloudSession.maxRetries::
|
||||
Maxmium number of tries to connect to GCloud DataStore to write sessions.
|
||||
jetty.gcloudSession.backoffMs::
|
||||
Amount of time, in milliseconds, between attempts to connect to the GCloud DataStore to write sessions.
|
||||
|
||||
//TODO - Add index.yaml properties?
|
|
@ -15,7 +15,7 @@
|
|||
// ========================================================================
|
||||
|
||||
[[configuring-sessions-gcloud]]
|
||||
=== Configuring Session Clustering with Google Cloud DataStore
|
||||
=== Clustered Session Management: Google Cloud DataStore
|
||||
|
||||
==== Preparation
|
||||
|
||||
|
@ -30,8 +30,8 @@ Before running Jetty, you will need to choose one of the following methods to se
|
|||
|
||||
1. Using the GCloud SDK:
|
||||
* Ensure you have the GCloud SDK installed: https://cloud.google.com/sdk/?hl=en.
|
||||
* Use the GCloud tool to set up the project you created in the preparation step: `GCloud config set project PROJECT_ID`
|
||||
* Use the GCloud tool to authenticate a google account associated with the project created in the preparation step: `GCloud auth login ACCOUNT`
|
||||
* Use the GCloud tool to set up the project you created in the preparation step: `gcloud config set project PROJECT_ID`
|
||||
* Use the GCloud tool to authenticate a google account associated with the project created in the preparation step: `gcloud auth login ACCOUNT`
|
||||
|
||||
2. Using environment variables
|
||||
* Define the environment variable `GCLOUD_PROJECT` with the project id you created in the preparation step.
|
||||
|
@ -45,7 +45,9 @@ The Google deployment tools will automatically configure the project and authent
|
|||
==== Configuring Indexes for Session Data
|
||||
|
||||
Regardless of whether you're running inside or outside google infrastructure you will need to upload a file that defines some indexes that are needed by the GCloud datastore session data store.
|
||||
This file is named `index.yaml` and you can find it in your distribution in `$jetty.home/etc/sessions/gcloud/index.yaml`.
|
||||
This file is named `index.yaml` and you can find it in your distribution in `${jetty.base}/etc/sessions/gcloud/index.yaml`.
|
||||
|
||||
//TODO - Add index.yaml properties? Test with new 9.4.x. It needs uploaded to Google as part of config
|
||||
|
||||
Follow the instructions link:https://cloud.google.com/datastore/docs/tools/#the_development_workflow_using_gcloud[here] to upload the pre-generated `index.yaml` file.
|
||||
|
||||
|
@ -55,3 +57,139 @@ To enable communication using the GCloud Emulator:
|
|||
|
||||
* Ensure you have the GCloud SDK installed: https://cloud.google.com/sdk/?hl=en
|
||||
* Follow the instructions link:https://cloud.google.com/datastore/docs/tools/datastore-emulator[here] on how to start the GCloud datastore emulator, and how to propagate the environment variables that it creates to the terminal in which you run Jetty.
|
||||
|
||||
==== Configuring the Google Cloud DataStore Module
|
||||
|
||||
When using the Jetty distribution, you will first need to enable the `session-store-gcloud` link:#startup-modules[module] for your link:#startup-base-and-home[Jetty base] using the `--add-to-start` argument on the command line.
|
||||
|
||||
|
||||
[source, screen, subs="{sub-order}"]
|
||||
----
|
||||
$ java -jar ../start.jar --create-startd
|
||||
INFO : Base directory was modified
|
||||
|
||||
$ java -jar ../start.jar --add-to-start=session-store-gcloud
|
||||
|
||||
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: session-store-gcloud
|
||||
+ GCloudDatastore is an open source project hosted on Github and released under the Apache 2.0 license.
|
||||
+ https://github.com/GoogleCloudPlatform/gcloud-java
|
||||
+ http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
Proceed (y/N)? y
|
||||
INFO : server initialised (transitively) in ${jetty.base}/start.d/server.ini
|
||||
INFO : sessions initialised (transitively) in ${jetty.base}/start.d/sessions.ini
|
||||
INFO : session-store-gcloud initialised in ${jetty.base}/start.d/session-store-gcloud.ini
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/cloud/gcloud-java-datastore/0.2.3/gcloud-java-datastore-0.2.3.jar to ${jetty.base}/lib/gcloud/gcloud-java-datastore-0.2.3.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/cloud/gcloud-java-core/0.2.3/gcloud-java-core-0.2.3.jar to ${jetty.base}/lib/gcloud/gcloud-java-core-0.2.3.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/auth/google-auth-library-credentials/0.3.1/google-auth-library-credentials-0.3.1.jar to ${jetty.base}/lib/gcloud/google-auth-library-credentials-0.3.1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/0.3.1/google-auth-library-oauth2-http-0.3.1.jar to ${jetty.base}/lib/gcloud/google-auth-library-oauth2-http-0.3.1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client-jackson2/1.19.0/google-http-client-jackson2-1.19.0.jar to ${jetty.base}/lib/gcloud/google-http-client-jackson2-1.19.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.1.3/jackson-core-2.1.3.jar to ${jetty.base}/lib/gcloud/jackson-core-2.1.3.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client/1.21.0/google-http-client-1.21.0.jar to ${jetty.base}/lib/gcloud/google-http-client-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar to ${jetty.base}/lib/gcloud/jsr305-1.3.9.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar to ${jetty.base}/lib/gcloud/httpclient-4.0.1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar to ${jetty.base}/lib/gcloud/httpcore-4.0.1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/commons-codec/commons-codec/1.3/commons-codec-1.3.jar to ${jetty.base}/lib/gcloud/commons-codec-1.3.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/oauth-client/google-oauth-client/1.21.0/google-oauth-client-1.21.0.jar to ${jetty.base}/lib/gcloud/google-oauth-client-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/guava/guava/19.0/guava-19.0.jar to ${jetty.base}/lib/gcloud/guava-19.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/api-client/google-api-client-appengine/1.21.0/google-api-client-appengine-1.21.0.jar to ${jetty.base}/lib/gcloud/google-api-client-appengine-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/oauth-client/google-oauth-client-appengine/1.21.0/google-oauth-client-appengine-1.21.0.jar to ${jetty.base}/lib/gcloud/google-oauth-client-appengine-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/oauth-client/google-oauth-client-servlet/1.21.0/google-oauth-client-servlet-1.21.0.jar to ${jetty.base}/lib/gcloud/google-oauth-client-servlet-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client-jdo/1.21.0/google-http-client-jdo-1.21.0.jar to ${jetty.base}/lib/gcloud/google-http-client-jdo-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/api-client/google-api-client-servlet/1.21.0/google-api-client-servlet-1.21.0.jar to ${jetty.base}/lib/gcloud/google-api-client-servlet-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/javax/jdo/jdo2-api/2.3-eb/jdo2-api-2.3-eb.jar to ${jetty.base}/lib/gcloud/jdo2-api-2.3-eb.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/javax/transaction/transaction-api/1.1/transaction-api-1.1.jar to ${jetty.base}/lib/gcloud/transaction-api-1.1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client-appengine/1.21.0/google-http-client-appengine-1.21.0.jar to ${jetty.base}/lib/gcloud/google-http-client-appengine-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client-jackson/1.21.0/google-http-client-jackson-1.21.0.jar to ${jetty.base}/lib/gcloud/google-http-client-jackson-1.21.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/org/codehaus/jackson/jackson-core-asl/1.9.11/jackson-core-asl-1.9.11.jar to ${jetty.base}/lib/gcloud/jackson-core-asl-1.9.11.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/joda-time/joda-time/2.9.2/joda-time-2.9.2.jar to ${jetty.base}/lib/gcloud/joda-time-2.9.2.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/org/json/json/20151123/json-20151123.jar to ${jetty.base}/lib/gcloud/json-20151123.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/cloud/datastore/datastore-v1beta3-protos/1.0.0-beta/datastore-v1beta3-protos-1.0.0-beta.jar to ${jetty.base}/lib/gcloud/datastore-v1beta3-protos-1.0.0-beta.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/protobuf/protobuf-java/3.0.0-beta-1/protobuf-java-3.0.0-beta-1.jar to ${jetty.base}/lib/gcloud/protobuf-java-3.0.0-beta-1.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/cloud/datastore/datastore-v1beta3-proto-client/1.0.0-beta.2/datastore-v1beta3-proto-client-1.0.0-beta.2.jar to ${jetty.base}/lib/gcloud/datastore-v1beta3-proto-client-1.0.0-beta.2.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/http-client/google-http-client-protobuf/1.20.0/google-http-client-protobuf-1.20.0.jar to ${jetty.base}/lib/gcloud/google-http-client-protobuf-1.20.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/api-client/google-api-client/1.20.0/google-api-client-1.20.0.jar to ${jetty.base}/lib/gcloud/google-api-client-1.20.0.jar
|
||||
DOWNLOAD: http://central.maven.org/maven2/com/google/guava/guava-jdk5/13.0/guava-jdk5-13.0.jar to ${jetty.base}/lib/gcloud/guava-jdk5-13.0.jar
|
||||
INFO : Base directory was modified
|
||||
WARN : Module session-store-gcloud requires jcl-impl from one of [jcl, jcl-slf4j]
|
||||
|
||||
WARN : Module session-store-gcloud requires jcl-api from one of [jcl, jcl-slf4j]
|
||||
|
||||
WARN : Unsatisfied module dependencies: session-store-gcloud,session-store-gcloud
|
||||
|
||||
Usage: java -jar $JETTY_HOME/start.jar [options] [properties] [configs]
|
||||
java -jar $JETTY_HOME/start.jar --help # for more information
|
||||
----
|
||||
|
||||
Doing this enables the GCloud Session module and any dependent session modules or files needed for it to run on the server.
|
||||
The example above is running an fresh `${jetty.base}` with nothing enabled.
|
||||
Because the Google Cloud DataStore 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).
|
||||
You will notice, however, that the above output presented a warning: GCloud requires certain Java Commons Logging features to work correctly.
|
||||
As such, you will also need to enable either the `jcl` or `jcl-slf4j` module.
|
||||
|
||||
[source, screen, subs="{sub-order}"]
|
||||
----
|
||||
$ java -jar ../start.jar --add-to-start=jcl
|
||||
|
||||
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: jcl
|
||||
+ Log4j is released under the Apache 2.0 license.
|
||||
+ http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
Proceed (y/N)? y
|
||||
INFO : jcl initialised in ${jetty.base}/start.d/jcl.ini
|
||||
DOWNLOAD: http://central.maven.org/maven2/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar to ${jetty.base}/lib/jcl/commons-logging-1.1.3.jar
|
||||
INFO : Base directory was modified
|
||||
----
|
||||
|
||||
When the `--add-to-start` argument was added to the command line the first time, it enabled the the `session-store-gcloud` module as well as the `sessions` and `server` modules, which are required for GCloud session management to operate; the `jcl` module was added when we ran it the second time.
|
||||
In addition to adding these modules to the classpath of the server it also added several ini configuration files to the `start.d` directory of the `${jetty.base}`.
|
||||
|
||||
____
|
||||
[NOTE]
|
||||
If you have updated versions of the jar files automatically downloaded by Jetty, you can place them in the associated `${jetty.base}/lib/` directory and use the `--skip-file-validation=<module name>` command line option to prevent errors when starting your server.
|
||||
____
|
||||
|
||||
Opening the `start.d/session-store-gcloud.ini` will show a list of all the configurable properties for the Google Cloud DataStore module:
|
||||
|
||||
[source, screen, subs="{sub-order}"]
|
||||
----
|
||||
# ---------------------------------------
|
||||
# Module: session-store-gcloud
|
||||
# Enables GCloudDatastore session management.
|
||||
# ---------------------------------------
|
||||
--module=session-store-gcloud
|
||||
|
||||
|
||||
## GCloudDatastore Session config
|
||||
#jetty.session.gcloud.maxRetries=5
|
||||
#jetty.session.gcloud.backoffMs=1000
|
||||
#jetty.session.gcloud.model.kind=GCloudSession
|
||||
#jetty.session.gcloud.model.id=id
|
||||
#jetty.session.gcloud.model.contextPath=contextPath
|
||||
#jetty.session.gcloud.model.vhost=vhost
|
||||
#jetty.session.gcloud.model.accessed=accessed
|
||||
#jetty.session.gcloud.model.lastAccessed=lastAccessed
|
||||
#jetty.session.gcloud.model.createTime=createTime
|
||||
#jetty.session.gcloud.model.cookieSetTime=cookieSetTime
|
||||
#jetty.session.gcloud.model.lastNode=lastNode
|
||||
#jetty.session.gcloud.model.expiry=expiry
|
||||
#jetty.session.gcloud.model.maxInactive=maxInactive
|
||||
#jetty.session.gcloud.model.attributes=attributes
|
||||
----
|
||||
|
||||
jetty.session.gcloud.maxRetries::
|
||||
Maxmium number of tries to connect to GCloud DataStore to write sessions.
|
||||
jetty.session.gcloud.backoffMs::
|
||||
Amount of time, in milliseconds, between attempts to connect to the GCloud DataStore to write sessions.
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
[[configuring-sessions-infinispan]]
|
||||
|
||||
=== Configuring Remote Session Clustering with Inifinspan
|
||||
=== Clustered Session Management: Inifinspan
|
||||
|
||||
When using the Jetty distribution, you will first need to enable the `session-store-infinispan-remote` link:#startup-modules[module] for your link:#startup-base-and-home[Jetty base] using the `--add-to-start` argument on the command line.
|
||||
|
||||
|
@ -69,20 +69,20 @@ Opening the `start.d/session-store-infinispan-remote.ini` will show a list of al
|
|||
# ---------------------------------------
|
||||
--module=session-store-infinispan-remote
|
||||
|
||||
#jetty.session.remoteInfinispanCache.name=sessions
|
||||
#jetty.session.infinispanIdleTimeout.seconds=0
|
||||
#jetty.session.infinispan.remoteCacheName=sessions
|
||||
#jetty.session.infinispan.idleTimeout.seconds=0
|
||||
#jetty.session.gracePeriod.seconds=3600
|
||||
----
|
||||
|
||||
jetty.session.remoteInfinispanCache.name::
|
||||
jetty.session.infinispan.remoteCacheName::
|
||||
Name of the cache in Infinispan where sessions will be stored.
|
||||
jetty.session.infinispanIdleTimeout.seconds::
|
||||
jetty.session.infinispan.idleTimeout.seconds::
|
||||
Amount of time, in seconds, that the system allows the connector to remain idle before closing the connection.
|
||||
jetty.session.gracePeriod.seconds::
|
||||
Amount of time, in seconds, to wait for other nodes to be checked to verify an expired session is in fact expired throughout the cluster before closing it.
|
||||
|
||||
|
||||
=== Configuring Embedded Inifinspan Clustering
|
||||
==== Configuring Embedded Inifinspan Clustering
|
||||
|
||||
During testing, it can be helpful to run an in-process instance of Infinispan.
|
||||
To enable this you will first need to enable the `session-store-infinispan-embedded` link:#startup-modules[module] for your link:#startup-base-and-home[Jetty base] using the `--add-to-start` argument on the command line.
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
[[configuring-sessions-jdbc]]
|
||||
|
||||
=== Configuring JDBC Clustering
|
||||
=== Clustered Session Management: JDBC
|
||||
|
||||
When using the Jetty distribution, you will first need to enable the `session-store-jdbc` link:#startup-modules[module] for your link:#startup-base-and-home[Jetty base] using the `--add-to-start` argument on the command line.
|
||||
|
||||
|
@ -55,49 +55,40 @@ Opening the `start.d/session-store-jdbc.ini` will show a list of all the configu
|
|||
|
||||
## Connection type:Datasource
|
||||
db-connection-type=datasource
|
||||
#jetty.session.datasourceName=/jdbc/sessions
|
||||
#jetty.session.jdbc.datasourceName=/jdbc/sessions
|
||||
|
||||
## Connection type:driver
|
||||
#db-connection-type=driver
|
||||
#jetty.session.driverClass=
|
||||
#jetty.session.driverUrl=
|
||||
#jetty.session.jdbc.driverClass=
|
||||
#jetty.session.jdbc.driverUrl=
|
||||
|
||||
## Session table schema
|
||||
#jetty.sessionTableSchema.accessTimeColumn=accessTime
|
||||
#jetty.sessionTableSchema.contextPathColumn=contextPath
|
||||
#jetty.sessionTableSchema.cookieTimeColumn=cookieTime
|
||||
#jetty.sessionTableSchema.createTimeColumn=createTime
|
||||
#jetty.sessionTableSchema.expiryTimeColumn=expiryTime
|
||||
#jetty.sessionTableSchema.lastAccessTimeColumn=lastAccessTime
|
||||
#jetty.sessionTableSchema.lastSavedTimeColumn=lastSavedTime
|
||||
#jetty.sessionTableSchema.idColumn=sessionId
|
||||
#jetty.sessionTableSchema.lastNodeColumn=lastNode
|
||||
#jetty.sessionTableSchema.virtualHostColumn=virtualHost
|
||||
#jetty.sessionTableSchema.maxIntervalColumn=maxInterval
|
||||
#jetty.sessionTableSchema.mapColumn=map
|
||||
#jetty.sessionTableSchema.table=JettySessions
|
||||
#jetty.session.jdbc.schema.accessTimeColumn=accessTime
|
||||
#jetty.session.jdbc.schema.contextPathColumn=contextPath
|
||||
#jetty.session.jdbc.schema.cookieTimeColumn=cookieTime
|
||||
#jetty.session.jdbc.schema.createTimeColumn=createTime
|
||||
#jetty.session.jdbc.schema.expiryTimeColumn=expiryTime
|
||||
#jetty.session.jdbc.schema.lastAccessTimeColumn=lastAccessTime
|
||||
#jetty.session.jdbc.schema.lastSavedTimeColumn=lastSavedTime
|
||||
#jetty.session.jdbc.schema.idColumn=sessionId
|
||||
#jetty.session.jdbc.schema.lastNodeColumn=lastNode
|
||||
#jetty.session.jdbc.schema.virtualHostColumn=virtualHost
|
||||
#jetty.session.jdbc.schema.maxIntervalColumn=maxInterval
|
||||
#jetty.session.jdbc.schema.mapColumn=map
|
||||
#jetty.session.jdbc.schema.table=JettySessions
|
||||
----
|
||||
|
||||
jetty.session.gracePeriod.seconds::
|
||||
Amount of time, in seconds, to wait for other nodes to be checked to verify an expired session is in fact expired throughout the cluster before closing it.
|
||||
|
||||
db-connection-type::
|
||||
jetty.session.datasourceName::
|
||||
Set to either `datasource` or `driver` depending on the type of connection being used.
|
||||
jetty.session.jdbc.datasourceName::
|
||||
Name of the remote datasource.
|
||||
jetty.session.jdbc.driverClass::
|
||||
Name of the JDBC driver that controls access to the remote database, such as `com.mysql.jdbc.Driver`
|
||||
jetty.session.jdbc.driverUrl::
|
||||
Url of the database which includes the driver type, host name and port, service name and any specific attributes unique to the database, such as a username.
|
||||
As an example, here is a mysql connection with the username appended: `jdbc:mysql://127.0.0.1:3306/sessions?user=sessionsadmin`.
|
||||
|
||||
db-connection-type::
|
||||
jetty.session.driverClass::
|
||||
jetty.session.driverUrl::
|
||||
|
||||
jetty.sessionTableSchema.accessTimeColumn::
|
||||
jetty.sessionTableSchema.contextPathColumn::
|
||||
jetty.sessionTableSchema.cookieTimeColumn::
|
||||
jetty.sessionTableSchema.createTimeColumn::
|
||||
jetty.sessionTableSchema.expiryTimeColumn::
|
||||
jetty.sessionTableSchema.lastAccessTimeColumn::
|
||||
jetty.sessionTableSchema.lastSavedTimeColumn::
|
||||
jetty.sessionTableSchema.idColumn::
|
||||
jetty.sessionTableSchema.lastNodeColumn::
|
||||
jetty.sessionTableSchema.virtualHostColumn::
|
||||
jetty.sessionTableSchema.maxIntervalColumn::
|
||||
jetty.sessionTableSchema.mapColumn::
|
||||
jetty.sessionTableSchema.table::
|
||||
The `jetty.sessionTableSchema` values represent the names for the columns in the JDBC database and can be changed to suit your environment.
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
[[configuring-sessions-mongo]]
|
||||
|
||||
=== Configuring Session Clustering with MongoDB
|
||||
=== Clustered Session Management: MongoDB
|
||||
|
||||
When using the Jetty distribution, you will first need to enable the `session-store-mongo` link:#startup-modules[module] for your link:#startup-base-and-home[Jetty base] using the `--add-to-start` argument on the command line.
|
||||
|
||||
|
@ -68,14 +68,20 @@ Opening the `start.d/session-store-mongo.ini` will show a list of all the config
|
|||
# ---------------------------------------
|
||||
--module=session-store-mongo
|
||||
|
||||
#jetty.session.dbName=HttpSessions
|
||||
#jetty.session.collectionName=jettySessions
|
||||
#jetty.session.mongo.dbName=HttpSessions
|
||||
#jetty.session.mongo.collectionName=jettySessions
|
||||
#jetty.session.mongo.host=localhost
|
||||
#jetty.session.mongo.port=27017
|
||||
#jetty.session.gracePeriod.seconds=3600
|
||||
----
|
||||
|
||||
jetty.session.dbName::
|
||||
jetty.session.mongo.dbName::
|
||||
Name of the database in Mongo used to store the Session collection.
|
||||
jetty.session.collectionName::
|
||||
jetty.session.mongo.collectionName::
|
||||
Name of the collection in Mongo used to keep all of the Sessions.
|
||||
jetty.session.mongo.host::
|
||||
Host name or address for the remote Mongo instance.
|
||||
jetty.session.mongo.port::
|
||||
Port number for the remote Mongo instance.
|
||||
jetty.session.gracePeriod.seconds::
|
||||
Amount of time, in seconds, to wait for other nodes to be checked to verify an expired session is in fact expired throughout the cluster before closing it.
|
||||
|
|
|
@ -42,6 +42,10 @@ However, it is possible to provide your own implementation that never shares Ses
|
|||
Where the `SessionCache` handles Session information, Session data is stored in a `SessionDataStore` that is specific to the clustering technology being implemented.
|
||||
There is only one (1) `SessionDataStore` per `SessionCache`.
|
||||
|
||||
//TODO : Information on memcache-d, when to use different config options. "Configuration Scenarios?"
|
||||
// Null cache, memcache, non-sticky load-balancer
|
||||
// in-memory caching
|
||||
|
||||
Visually the Session Hierarchy can be represented like this:
|
||||
|
||||
image::images/SessionsHierarchy.png[]
|
||||
|
@ -49,7 +53,7 @@ image::images/SessionsHierarchy.png[]
|
|||
==== Configuring Sessions in the Jetty Distribution
|
||||
|
||||
Jetty provides support for several different Session Management technologies.
|
||||
Both link:#configuring-sessions-file-system[local file storage] and link:#configuring-sessions-jdbc[JDBC] Session Management can be implemented for standard implementations.
|
||||
For implementations using clusted technologies, link:#configuring-sessions-mongo[MongoDB], link:#configuring-sessions-infinispan[Inifinispan] and link:#configuring-sessions-gcloud[Google Cloud Datastore] are all supported.
|
||||
Both link:#configuring-sessions-file-system[local file storage] and in-memory session management can be implemented for standard implementations.
|
||||
For implementations using clustered technologies, link:#configuring-sessions-jdbc[JDBC], link:#configuring-sessions-mongo[MongoDB], link:#configuring-sessions-infinispan[Inifinispan] and link:#configuring-sessions-gcloud[Google Cloud Datastore] are all supported.
|
||||
Setting up these technologies is as easy as enabling it's link:#startup-modules[module] and editing it's associated ini file with any usernames, passwords or changes you need to make for your instance.
|
||||
The following sections will cover how exactly to enable the required modules as well as an overview of what options are available for customization.
|
||||
|
|
Loading…
Reference in New Issue