Difference between revisions of "Usage Tracker Installation"

From Gcube Wiki
Jump to: navigation, search
(Deploying the Usage Tracker in Tomcat)
(Configuration)
 
(24 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
[[Category:Administrator's Guide]]
 
==System requirements==
 
==System requirements==
  
 
* Java runtime environment (openjdk)
 
* Java runtime environment (openjdk)
 
* Apache Tomcat version 5.0 or higher
 
* Apache Tomcat version 5.0 or higher
 +
* MongoDB version 2.2 or higher
  
 
==Download==
 
==Download==
  
Binaries of the Usage Tracker are available in .deb and .rpm format.
+
Download the latest version of the Usage Tracker from the latest Stable Build ([https://grids16.eng.it/BuildReport/home/Recent_Builds/org.gcube.3-0-0/ org.gcube.accounting.usagetracker-2.1.0-0.tar.gz]) Make sure you get the latest Build.
Packages can be downloaded from:
+
 
+
* [http://resources.venus-c.eu/accounting/deb/venusc-mab-usagetracker-2.0.0-latest.deb usagetracker.deb]
+
 
+
* [http://resources.venus-c.eu/accounting/rpm/venusc-mab-usagetracker-2.0.0-latest.noarch.rpm usagetracker.noarch.rpm]
+
  
 
==Install==
 
==Install==
  
Once you've downloaded the package format suitable for your system, the Usage Tracker can be installed by running:
+
Create the installation directory /opt/gcube-accounting
  
* <pre>dpkg -i venusc-mab-usagetracker-«version».deb</pre>
+
Create the log directory /var/log/gcube-accounting
  
or
+
Once you've downloaded the package, extract the Usage Tracker tar.gz into /opt/gcube-accounting folder on your machine.
 
+
* <pre>rpm -i venusc-mab-usagetracker-«version».noarch.rpm</pre>
+
  
 
==Prerequisites==
 
==Prerequisites==
  
 
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.
 
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==
 
==Configuration==
  
Configuration of the usage tracker is entirely property-file-based. The pre-defined location for configuration files is ''/opt/venus-c/etc/''.
+
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:
 
Two configuration files are expected by the usage tracker:
  
 
<pre>
 
<pre>
/opt/venus-c/etc/venusc-mab-usagetracker.properties
+
/opt/gcube-accounting/etc/gcube-accounting-usagetracker.properties
/opt/venus-c/etc/venusc-mab-usagetracker-log4j.properties
+
/opt/gcube-accounting/etc/gcube-accounting-usagetracker-log4j.properties
 
</pre>
 
</pre>
  
Line 45: Line 39:
 
authn.enabled = false
 
authn.enabled = false
 
authz.enabled = false
 
authz.enabled = false
 +
</pre>
 +
 +
 +
Besides, you should configure the infrastructure properties related to the Message Broker instance (in particular endpoint and scopes):
 +
 +
<pre>
 +
infrastructure.broker = <protocol>://<brokerEndpoint>:<port>
 +
infrastructure.scopes = <scopes>
 +
</pre>
 +
 +
it is strongly suggested to use a [http://activemq.apache.org/failover-transport-reference.html failover transport] to eneble the Usage Tracker to autonomously reconnect to the broker after a failure or a restart:
 +
 +
<pre>
 +
infrastructure.broker = failover:(<protocol>://<brokerEndpoint>:<port>)
 +
</pre>
 +
 +
failover transport also supports multiple brokers:
 +
 +
<pre>
 +
infrastructure.broker = failover:(<protocol>://<brokerEndpoint>:<port>,<protocol2>://<brokerEndpoint2>:<port2>,<protocol3>://<brokerEndpoint3>:<port3>)
 +
</pre>
 +
 +
with randomized load balancing or several different [http://activemq.apache.org/failover-transport-reference.html options].
 +
 +
You should enable/disable the use of the remote database instance (MongoDB cluster):
 +
 +
<pre>
 +
# 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>
 
</pre>
 
</pre>
  
 
==Deploying the Usage Tracker in Tomcat==
 
==Deploying the Usage Tracker in Tomcat==
  
The service should be deployed automatically during installation. However, in case of trouble or manual (un)deployment, it can be done by:
+
The service should be manually deployed:
  
* copying the context file (i.e. ''/opt/venus-c/etc/usagetracker.xml'') to ''/etc/tomcat«ver»/conf/Catalina/localhost/''
+
* 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
 
* make sure Tomcat is up and running
  
 
==Testing your installation==
 
==Testing your installation==
  
Connect to http://<deployhost>:8080/usagetracker/rest/usagerecords you should get an empty XML result:
+
Connect to ''<nowiki>http://<deployhost>:8080/usagetracker/rest/usagerecords</nowiki>'' you should get an empty XML result:
<rawUsagerecords/>
+
<pre><rawUsagerecords/></pre>
 +
 
 +
==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:
 +
 
 +
<pre>
 +
 
 +
<Resource version="...">
 +
   
 +
  <ID>...</ID>
 +
   
 +
  <Type>RuntimeResource</Type>
 +
   
 +
  <Scopes>
 +
       
 +
      <Scope>...</Scope>
 +
   
 +
  </Scopes>
 +
   
 +
  <Profile>
 +
       
 +
      <Category>Service</Category>
 +
       
 +
      <Name>UsageTracker</Name>
 +
       
 +
      <Description />
 +
       
 +
      <Platform>
 +
           
 +
        <Name>UsageTracker</Name>
 +
           
 +
        <Version>2</Version>
 +
           
 +
        <MinorVersion>2</MinorVersion>
 +
           
 +
        <RevisionVersion>2</RevisionVersion>
 +
           
 +
        <BuildVersion>2</BuildVersion>
 +
       
 +
      </Platform>
 +
       
 +
      <RunTime>
 +
           
 +
        <HostedOn>hostname</HostedOn>
 +
           
 +
        <GHN UniqueID="" />
 +
           
 +
        <Status>READY</Status>
 +
       
 +
      </RunTime>
 +
       
 +
      <AccessPoint>
 +
           
 +
        <Description>UsageTracker Interface</Description>
 +
           
 +
        <Interface>
 +
               
 +
            <Endpoint EntryName="usageTrackerInterface">http://hostname:8080/usagetracker/rest</Endpoint>
 +
           
 +
        </Interface>
 +
           
 +
        <AccessData>
 +
               
 +
            <Username />
 +
               
 +
            <Password>...</Password>
 +
           
 +
        </AccessData>
 +
       
 +
      </AccessPoint>
 +
   
 +
  </Profile>
 +
 
 +
</Resource>
 +
</pre>

Latest revision as of 12:56, 26 June 2014

System requirements

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

Download

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.

Install

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.

Prerequisites

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

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:

/opt/gcube-accounting/etc/gcube-accounting-usagetracker.properties
/opt/gcube-accounting/etc/gcube-accounting-usagetracker-log4j.properties

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):

infrastructure.broker = <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:

infrastructure.broker = failover:(<protocol>://<brokerEndpoint>:<port>)

failover transport also supports multiple brokers:

infrastructure.broker = 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:

<rawUsagerecords/>

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="...">
    
   <ID>...</ID>
    
   <Type>RuntimeResource</Type>
    
   <Scopes>
        
      <Scope>...</Scope>
    
   </Scopes>
    
   <Profile>
        
      <Category>Service</Category>
        
      <Name>UsageTracker</Name>
        
      <Description />
        
      <Platform>
            
         <Name>UsageTracker</Name>
            
         <Version>2</Version>
            
         <MinorVersion>2</MinorVersion>
            
         <RevisionVersion>2</RevisionVersion>
            
         <BuildVersion>2</BuildVersion>
        
      </Platform>
        
      <RunTime>
            
         <HostedOn>hostname</HostedOn>
            
         <GHN UniqueID="" />
            
         <Status>READY</Status>
        
      </RunTime>
        
      <AccessPoint>
            
         <Description>UsageTracker Interface</Description>
            
         <Interface>
                
            <Endpoint EntryName="usageTrackerInterface">http://hostname:8080/usagetracker/rest</Endpoint>
            
         </Interface>
            
         <AccessData>
                
            <Username />
                
            <Password>...</Password>
            
         </AccessData>
        
      </AccessPoint>
    
   </Profile>

</Resource>