SG Accounting Client Installation
From EGEE-see WIki
Note: If you have installed the old version of the accounting client please go directly to the last section - Accounting Client - New Version
The goal of the accounting client is to transmit aggregated accounting information to the
web service at gserv1.ipp.acad.bg, with the aim to be able to produce usage summaries, which include
information about the applications and/or institutes for the users.
Thus only aggregated information about DNs is transferred, the individual
DNs of the users are kept locally.
This guide assumes that you have already properly working MON box, which reports accounting information either to the EGEE or to the SEE-GRID registry. You can follow:
http://wiki.egee-see.org/index.php/SG_RGMA_Installation_Guide
for the R-GMA/APEL configuration.
In order to install the accounting, one needs to use a non-root account at some node
that has at least read-only access to the database accounting at the site's MON box, and has access to a valid proxy.
The easiest setup is achieved by using user tomcat at the MON box.
The latest version of the accounting publisher client requires also that the database user USERNAME can create temporary tables. In mysql the setting of permissions for temporary tables is not organized in the best way, and we have to use a workaround. You need to login to mysql as root:
mysql -u root -pmysqlrootpasswrd
(password is in most cases in site-info.def).
and perform the following commands:
CREATE DATABASE tmp; GRANT CREATE TEMPORARY TABLES, SELECT, INSERT, UPDATE, DELETE, DROP, ALTER ON tmp.* TO 'USERNAME'@'HOSTNAME'
where USERNAME is the database user (not necessarily equal to the unix user), hostname is usually your MONBOX hostname.
If you had previous version of accounting publisher, use the same database username for that. If you decide to use the database user accounting, there is the disadvantage that it has write access to the real data, although the publisher only needs read access. If you decide to create a new database user, say 'tomcat', you can do the following at mysql root prompt (replace STRONGPASSWORD with a strong password of choice):
GRANT SELECT on accounting.* to 'tomcat'@'MONBOXHOSTNAME' identified by 'STRONGPASSWORD'; CREATE DATABASE tmp; GRANT SELECT, INSERT, UPDATE, DELETE, DROP, ALTER, CREATE TEMPORARY TABLES ON tmp.* TO 'tomcat4'@'MONBOXHOSTNAME';
After that you can proceed with the deployment.
Download the accounting rpms :
[https://gserv1.ipp.acad.bg:8443/Welcome/mpi_publisher-1.0-RHEL4.noarch.rpm mpi_publisher- 1.0-RHEL4.noarch.rpm] - on your CE (if your site does not suporrt MPI you don't have to install this rpm)
[https://gserv1.ipp.acad.bg:8443/Welcome/accounting_publisher-2.1-RHEL4.noarch.rpm accounting_publisher-2.1-RHEL4.noarch.rpm] - on your node (monbox) with the Accounting database.
Install mpi_publisher rpm:
rpm -Uvh mpi_publisher-1.0-RHEL4.noarch.rpm - on your CE
Install accountintg_publisher-2.1:
Install the rpm:
rpm -Uvh accounting_publisher-2.1-RHEL4.noarch.rpm - on your monbox
Change to this directory on your monbox and make sure that all files in the dir are with owner tomcat.
chown -R tomcat:tomcat /opt/seegrid/accounting_publisher-2.1/ cd /opt/seegrid/accounting_publisher-2.1/
Edit jvr.sh to fill in the details about SITENAME (do not use the variable $SITENAME! Replace with the name of your site in HGSM, e.g. BA-01-ETFBL), database name (accounting), etc. In most cases DBUSERNAME will be either 'tomcat' (if you follow the advice above) or 'accounting'. DBPASSWORD should be the mysql password of the database user $DBUSERNAME.
In the jvr.sh file the way to obtain a proxy is from the hostcert and key copies available to user tomcat:
grid-proxy-init -cert /etc/tomcat/hostcert.pem -key /etc/tomcat/hostkey.pem -out tmpproxy
If you are using different user, change accordingly.
export PATH=/opt/globus/bin:$PATH
The addition of /opt/globus/bin to the PATH is done in order for grid-proxy-init to be succesful.
Run jvr.sh by hand (note make sure that you are in /opt/seegrid/accounting_publisher-2.1/ dir )
su - tomcat cd /opt/seegrid/accounting_publisher-2.1/ ./jvr.sh
until you get it to publish something (look at the output, it should complete within a few minutes at most).
Check which is the path to a working java interpreter - which java should give you something like /usr/java/jdk1.5.0_16/bin/java, so the path is /usr/java/jdk1.5.0_16/bin
NOTE: If you want to use a different java version from the default change the JAVA variable and Java version is at least 1.5 or above
Look for errors in the console or accounting.log in the same directory where you deployed.
With this version data is published in two ways - first for all VOs, then
with some additional application specific information for SEE-GRID VO.
For any question or problems, contact - Dimitar Dimitrov
Good luck
Accounting Client - New Version
In order to install the new version of the Accounting Publisher(which supports MPI accounting) you have to install two rpms (please make sure that the old version is disabled - the cron jobs to avoid coflicts).
mpi_publisher-1.0-RHEL4.noarch.rpm - on your CE (if your site does not suporrt MPI you don't have to install this rpm)
accounting_publisher-2.1-RHEL4.noarch.rpm - on your node (monbox) with the Accounting database.
After installation accounting_publisher neeed configuration - just open /opt/seegrid/accounting_publisher-2.1/jvr.sh and set the following parameters DBHOSTNAME, DBUSERNAME, DBPASSWORD, DBSITENAME - use the same parameters as it is in the old version of the accounting publisher
