| 1 |
Cassandra session backend |
| 2 |
==================================== |
| 3 |
|
| 4 |
`Apache::Session::Browseable::Cassandra <https://metacpan.org/pod/Apache::Session::Browseable::Cassandra>`__ |
| 5 |
is a `Cassandra <https://cassandra.apache.org/>`__ session backend. |
| 6 |
|
| 7 |
Setup |
| 8 |
----- |
| 9 |
|
| 10 |
Install and launch a `Cassandra <https://cassandra.apache.org/>`__ server. |
| 11 |
Install |
| 12 |
`Apache::Session::Browseable <http://search.cpan.org/perldoc?Apache::Session::Browseable>`__ |
| 13 |
Perl module (version ⩾ 1.3.12 required). |
| 14 |
|
| 15 |
Prepare the database |
| 16 |
~~~~~~~~~~~~~~~~~~~~ |
| 17 |
|
| 18 |
Your database must have a specific table to host sessions. Here are some |
| 19 |
examples for main databases servers. |
| 20 |
|
| 21 |
.. code-block:: text |
| 22 |
|
| 23 |
CREATE KEYSPACE IF NOT EXISTS llng |
| 24 |
WITH REPLICATION = { |
| 25 |
'class' : 'SimpleStrategy', |
| 26 |
'replication_factor' : 1 |
| 27 |
}; |
| 28 |
DROP TABLE IF EXISTS llng.sessions; |
| 29 |
CREATE TABLE llng.sessions ( |
| 30 |
id text PRIMARY KEY, |
| 31 |
a_session text, |
| 32 |
# Indexed fields |
| 33 |
_whatToTrace text, |
| 34 |
_session_kind text, |
| 35 |
_utime text, |
| 36 |
ipAddr text |
| 37 |
); |
| 38 |
CREATE INDEX ON llng.sessions (_whatToTrace); |
| 39 |
CREATE INDEX ON llng.sessions (_session_kind); |
| 40 |
CREATE INDEX ON llng.sessions (_utime); |
| 41 |
CREATE INDEX ON llng.sessions (ipAddr); |
| 42 |
|
| 43 |
Manager |
| 44 |
~~~~~~~ |
| 45 |
|
| 46 |
In the manager: set |
| 47 |
`Apache::Session::Browseable::Cassandra <http://search.cpan.org/perldoc?Apache::Session::Browseable::Cassandra>`__ |
| 48 |
in ``General parameters`` » ``Sessions`` » ``Session storage`` » |
| 49 |
``Apache::Session module`` and add the following parameters (case |
| 50 |
sensitive): |
| 51 |
|
| 52 |
=================== ================================================= ========================================= |
| 53 |
Name Comment Example |
| 54 |
=================== ================================================= ========================================= |
| 55 |
**DataSource** The `DBI <https://metacpan.org/pod/DBI>`__ string dbi:Cassandra:host=10.2.3.1;keyspace=llng |
| 56 |
**UserName** The database username lemonldap-ng |
| 57 |
**Password** The database password mysuperpassword |
| 58 |
**TableName** *(Optional)* Name of the table sessions |
| 59 |
**Index** Indexed fields _whatToTrace _session_kind _utime ipAddr |
| 60 |
=================== ================================================= ========================================= |
| 61 |
|
| 62 |
Security |
| 63 |
-------- |
| 64 |
|
| 65 |
Restrict network access to the Cassandra server. For remote servers, you |
| 66 |
can use :doc:`SOAP session backend<soapsessionbackend>` in cunjunction |
| 67 |
to increase security for remote server that access through an unsecure |
| 68 |
network. |