Installation instructions

Requirements

Installation

  1. Download Clepsydra distribution package from our download site.
  2. Extract files from downloaded archive and navigate to clepsydra-storage directory.
    cd clepsydra-storage

PostgreSQL configuration

  1. Create a new database user and a new database owned by newly created user. A recommended name for database user and database name is clepsydra. If you want to use different name, remember to change DB_USER and DB_NAME properties in clepsydra-storage/clepsydra.conf.
  2. Set the user password property DB_PASS in clepsydra.conf.
  3. Create database schema using db/init.sql SQL script.

Apache Cassandra configuration

  1. Create a Cassandra keyspace (see http://www.datastax.com/docs/1.1/references/cql/CREATE_KEYSPACE).

    If you are unsure which options to choose you may create the keyspace with one of the following system specific commands:

    Linux users:

    echo 'CREATE KEYSPACE YOUR_KEYSPACE_NAME WITH strategy_class = SimpleStrategy AND strategy_options:replication_factor = 1'|cqlsh -2

    Windows users:

    echo CREATE KEYSPACE YOUR_KEYSPACE_NAME WITH strategy_class = SimpleStrategy AND strategy_options:replication_factor = 1; | python "%CASSANDRA_HOME%/bin/cqlsh" -2
  2. Set the keyspace name property CASSANDRA_KEYSPACE in clepsydra.conf.
  3. Use the CQLsh tool (from Apache Cassandra distribution) and db/create_cf.cql script to create column family. Example usage:

    Linux users:

    $CASSANDRA_HOME/bin/cqlsh -2 -k YOUR_KEYSPACE_NAME -f db/create_cf.cql

    Windows users:

    python "%CASSANDRA_HOME%/bin/cqlsh" -2 -k YOUR_KEYSPACE_NAME -f db/create_cf.cql

    NOTICE: if you are not using the default cluster name ("Test Cluster") please change the CASSANDRA_CLUSTER property in clepsydra.conf.

Glassfish configuration

Create new Glassfish server domain using create-clepsydra-domain.sh script. Please check if all properties in clepsydra.conf are filled and consistent with your databases configuration. Run the script:

sh create-clepsydra-domain.sh $GLASSFISH_HOME clepsydra.conf

NOTICE for Windows users: to run this script on Windows system please use Cygwin with "zip" and "wget" packages installed. Please make sure that there are no spaces in your $GLASSFISH_HOME path.

Install application

Deploy clepsydra-storage.war on Glassfish server using, for example, command:

$GLASSFISH_HOME/bin/asadmin deploy cassandra-storage.war

Verify installation

Open any browser and get content of url http://localhost:8080/clepsydra-storage/rest/records. If an application has been successfully installed, you should get response from the server with empty record list. It should look similar to the following:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recordQueryResult>
    <expirationDate>2013-03-01T10:10:13.199+01:00</expirationDate>
    <token>8f3cfe32-f668-4efc-93fd-8c26c5c9d895</token>
    <records/>
</recordQueryResult>