OBSOLETE: Installing the Billing Graphs
The obsolete method for installing the billing graphs. Only use this in older installs which cannot be upgraded.
On this page, we will focus on how to deploy the billing graphs to mine the billing DB. This is more of a work-in-progress than a set of documentation.
Steps:
OLD METHOD:
Set up GraphTool to the point where you can run "import graphtool" from python. See this page for install directions. Make sure that you have installed the CherryPy server and Postgres bindings, as discussed on that page.
- Download the dCacheNebraska source code:
- Make sure the svn binary is installed (do "yum install subversion" if necessary), then:
svn co svn://t2.unl.edu/brian/dCacheNebraska
You will be using the files in the billing_graphs directory. NEW METHOD:
- Alter Apache's httpd.conf (you'll need to change your hostname where appropriate, or substitute code which does something equivalent). You will find the necessary additions here. Restart Apache afterward, of course. If you do not use Apache, you must access the billing DB using this URL format:http://hostname.unl.edu:8098/billing/xml/Note the trailing slash and the port number.
- Load the schema found here into the billing db (psql -u srmdcache billing). This can be done easily from the command line with this command:
curl http://t2.unl.edu:8092/browser/dCacheNebraska/python_src/dCacheNebraska/billing/config/billing_additions.sql?format=raw | psql -U srmdcache billing
You may have to provide a password or change the user name, depending on your Postgres setup. - Edit the DBSrm.xml file in your /etc directory. It must have the following format (sorry for the obscure format...)
<graphtool-config>
I apologize for the weird XML format when a flat text file would suffice. This will be fixed later.
<import module="graphtool.database.connection_manager"> ConnectionManager </import>
<class name="BillingConnMan" type="ConnectionManager" default="billing">
<attribute name="default"> billing </attribute>
<connection name="billing">
<attribute name="Interface"> Postgres </attribute>
<attribute name="Database"> billing </attribute>
<attribute name="Host">myhost.unl.edu</attribute>
<attribute name="AuthDBUsername"> postgres </attribute>
<!-- attribute name="AuthDBPassword"> blah </attribute -->
</connection>
</class>
</graphtool-config>
OLD METHOD:
- Edit setup.sh to match your local needs (blow away the CMS references if you have used the Python Eggs install and placed the eggs somewhere already in the PYTHONPATH).
- Source setup.sh
- Start billing-web.py - it should now be in your path. Make sure that the web interface shows up at http://your-host/billing/xml/ (trailing slash is important), if you are using Apache. Otherwise, it appears at http://your-host:8098/billing/xml/. If graphs appear, restart the server in the background:
nohup billing-web.py 2>&1 > /dev/null &
NEW METHOD:
- Add the dCacheNebraskaWeb script to startup, then start it by hand:
chkconfig --add dCacheNebraskaWeb
service dCacheNebraskaWeb start - Restart the cell with the billing cell; usually, it can be done as:
/opt/d-cache/jobs/httpd stop && /opt/d-cache/jobs/httpd start
- Enjoy! Please provide me with feedback if you get hung up somewhere.