Usage Tracker Installation

From Gcube Wiki
Revision as of 13:56, 26 June 2014 by Ciro.formisano (Talk | contribs) (Configuration)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

System requirements

  • Java runtime environment (openjdk)
  • Apache Tomcat version 5.0 or higher
  • MongoDB version 2.2 or higher


Download the latest version of the Usage Tracker from the latest Stable Build (org.gcube.accounting.usagetracker-2.1.0-0.tar.gz) Make sure you get the latest Build.


Create the installation directory /opt/gcube-accounting

Create the log directory /var/log/gcube-accounting

Once you've downloaded the package, extract the Usage Tracker tar.gz into /opt/gcube-accounting folder on your machine.


The Usage Tracker adopts a document-oriented database (MongoDB in the current implementation) to persist records. A running instance of MongoDB is expected by the Usage Tracker. The instance can either run on the local machine or a remote one.


Configuration of the usage tracker is entirely property-file-based. The pre-defined location for configuration files is /opt/gcube-accounting/etc/. Two configuration files are expected by the usage tracker:


The first one provides connection parameters (e.g. location, db name, username, password) for the records database. The second one just configures logging facilities.

You should disable the Usage Tracker internal security by editing the first configuration file in this way:

authn.enabled = false
authz.enabled = false

Besides, you should configure the infrastructure properties related to the Message Broker instance (in particular endpoint and scopes): = <protocol>://<brokerEndpoint>:<port>
infrastructure.scopes = <scopes>

it is strongly suggested to use a failover transport to eneble the Usage Tracker to autonomously reconnect to the broker after a failure or a restart: = failover:(<protocol>://<brokerEndpoint>:<port>)

failover transport also supports multiple brokers: = failover:(<protocol>://<brokerEndpoint>:<port>,<protocol2>://<brokerEndpoint2>:<port2>,<protocol3>://<brokerEndpoint3>:<port3>)

with randomized load balancing or several different options.

You should enable/disable the use of the remote database instance (MongoDB cluster):

# where the database is hosted
dbHost = <hostname>

# on what port it responds
dbPort = <port>

# the name of the database
dbName = <databaseName>

# database authentication
dbAuthn = <false|true>
# db account information
dbUser = <dbUsername>
dbPassword = <dbPassword>

Deploying the Usage Tracker in Tomcat

The service should be manually deployed:

  • copy the context file (i.e. /opt/gcube-accounting/etc/usagetracker.xml) to /etc/tomcat«ver»/conf/Catalina/localhost/
  • make sure Tomcat is up and running

Testing your installation

Connect to http://<deployhost>:8080/usagetracker/rest/usagerecords you should get an empty XML result:


IS integration

The Usage Tracker service must be registered as a Runtime Resource on the IS, using the Resources Management portlet. Below is an example of the resource configuration:

<Resource version="...">
      <Description />
         <GHN UniqueID="" />
         <Description>UsageTracker Interface</Description>
            <Endpoint EntryName="usageTrackerInterface">http://hostname:8080/usagetracker/rest</Endpoint>
            <Username />