release notes | Book: 1.9.5, 1.9.12 (opt, FHS), 2.6 (FHS), 2.7 (FHS), 2.8 (FHS), 2.9 (FHS), 2.10 (FHS), 2.11 (FHS), | Wiki | Q&A black_bg
Web: Multi-page, Single page | PDF: A4-size, Letter-size | eBook: epub black_bg

The billing database

In order to enable the database, the following steps must be taken.

  1. If the "billing" database does not already exist (see further below on migrating from an existing one), create it (we assume PostgreSQL here):

    [root] # createdb -O srmdcache -U postgres billing

    If you are using a version of PostgreSQL prior to 8.4, you will also need to do:

    [root] # createlang -U srmdcache plpgsql billing

    No further manual preparation is needed, as the necessary tables, indices, functions and triggers will automatically be generated when you (re)start the domain with the billing database logging turned on (see below).

  2. The property billingToDb controls whether the billing cell sends billing messages to the database. By default the option is disabled. To activate, set the value to yes and restart the domain in which the httpd service is running.

    Example:

    Extract from the layout file:

    [httpdDomain]
            billingToDb=yes
    [httpdDomain/httpd]
    [httpdDomain/billing]
    ...

    [root] # dcache restart httpdDomain
    Stopping httpdDomain 0 1 done
    Starting httpdDomain done

[return to top]

Customizing the database

In most cases, the billing service will be run out-of-the-box; nevertheless, the administrator does have control, if this is desired, over the database configuration.

  • Database name, host, user, and password can be easily modified using the properties:

    • billingDbName
    • billingDbHost
    • billingDbUser
    • billingDbPass

    The current database values can be checked with the dcache database ls command.

    Example:

    # dcache database ls
    DOMAIN          CELL        DATABASE HOST      USER      MANAGEABLE AUTO
    namespaceDomain PnfsManager chimera  localhost chimera   Yes        Yes
    namespaceDomain cleaner     chimera  localhost chimera   No         No
    httpdDomain     billing     billing  localhost srmdcache Yes        Yes
  • Database inserts are batched for performance, and are controlled by the following properties:

    • billingMaxInsertsBeforeCommit (defaults to 10000)
    • billingMaxTimeBeforeCommitInSecs (defaults to 5)

    The default settings should usually be sufficient.

  • Should finer control over the DataNucleus layer (which talks to the database) be needed, then a new datanucleus.properties file must be provided. The path to this file, which will override the internal settings, should be indicated using:

    • billingInfoAccessPropertiesFile (defaults to "")

    Changing this configuration requires an understanding of DataNucleus , and we expect it will be rather uncommon to utilize this option (it is suggested that the administrator in this case consult with a member of the dCache team).

  • Changing the database type (which defaults to PostgreSQL) to something else would entail the above-mentioned necessary modification of the datanucleus.properties as well as changing the billingDbDriver and billingDbUrl properties appropriately. This is not a recommended procedure, though in certain exceptional circumstances, it may be desirable or necessary. Once again, consultation with the dCache team is suggested in this case.