QCG-Notification installation in Debian

This document describes procedures needed to install QCG-Notification in Debian using apt-get and debian packages uploaded to the Debian QosQosGrid repository.

Installation

The one who want to install QCG-Notification on Debian should follow these steps:

  • ensure that the qcg-ntf user is present in a system, otherwise create it:
    useradd -r -d /var/log/qcg-ntf/ qcg-ntf
    
  • ensure that the qcg-dev group is present in a system, otherwise create it:
    groupadd -r qcg-dev
    
  • install the QosCosGrid Debian repository:
    cat > /etc/apt/sources.list.d/qcg.unstable.list << EOF
    deb http://elder8.man.poznan.pl/debian unstable main
    EOF
    
  • add the public key of the QCG repository to your trusted keys in the apt configuration:
    wget https://apps.man.poznan.pl/trac/qcg-notification/raw-attachment/wiki/InstallingUsingDeb/qcg.pub
    apt-key add qcg.pub
    
  • refresh the packages list:
    apt-get update
    
  • install QCG-Notification:
    apt-get install qcg-ntf
    
  • setup QCG-Notification database using provided script:
    /usr/share/qcg-ntf/tools/qcg-ntf-install-debian.sh
    Welcome to qcg-ntf installation script!
    
    This script will guide you through process of configuring proper environment
    for running the QCG-Notification service. You have to answer few questions regarding
    parameters of your database. If you are not sure just press Enter and use the
    default values.
      
    Use local PostgreSQL server? (y/n) [y]: y
    Database [qcg-ntf]: 
    User [qcg-ntf]: 
    Password [qcg-ntf]: MojeTajneHaslo
    Create database? (y/n) [y]: y
    Create user? (y/n) [y]: y
      
    Checking for system user qcg_ntf...OK
    Checking whether PostgreSQL server is installed...OK
    Checking whether PostgreSQL server is running...OK
      
    Performing installation
    * Creating user qcg-ntf...OK
    * Creating database qcg-ntf...OK
    * Creating database schema...OK
    * Checking for ODBC data source qcg-ntf...
    * Installing ODBC data source...OK
        
    Remember to add appropriate entry to /etc/postgresql/X.Y/main/pg_hba.conf (as the first rule!) to allow user qcg-ntf to
    access database qcg-ntf. For instance:
      
    host    qcg-ntf       qcg-ntf       127.0.0.1/32    md5
      
    and reload Postgres server.
    

  • Add a new rule to the pg_hba.conf as requested:
    vim /etc/postgresql/8.4/main/pg_hba.conf 
    /etc/init.d/postgresql reload
    

Configuration

Service configuration

The service should be ready to use "out-of-the-box", however the basic configuration may be needed to setup Host and Port on which QCG-Notification should listen as well as parameters of database connection: DSN, User and Password. It can be done by editing the main QCG-Notification configuration file located in: /etc/qcg-ntf/qcg-ntfd.xml. A part of the configuration file with marked key parameters is presented below:

<sm:QCGCore 
   <Configuration>
   ....
              <sm:Module xsi:type="sm:ecm_gsoap.service">
                  <sm:Host>127.0.0.1</sm:Host>
                  <sm:Port>19001</sm:Port>
                  <sm:UseWsa>true</sm:UseWsa>
              </sm:Module>
   ....
              <smn:Database>
                  <smn:DatabaseEnabled>true</smn:DatabaseEnabled>
                  <smn:DSN>qcg-ntf</smn:DSN>
                  <smn:User>qcg-ntf</smn:User>
                  <smn:Password>qcg-ntf</smn:Password>
                  <smn:CleanAtStart>false</smn:CleanAtStart>
              </smn:Database>
   ....
   </Configuration>
</sm:QCGCore>

For more information about configuration of the service please take a look at the QCG-Notification technical guide and manual.

Running the service

The QCG-Notification initialization script is automatically added to init.d directory and may be run as a standard system service:

/etc/init.d/qcg-ntf start

The service logs can be found in:

/var/log/qcg-ntf/qcg-ntfd.log

It could be then stopped with the following command:

/etc/init.d/qcg-ntfd stop

Note: qcg-ntfd will be started with the qcg_ntf user permissions.

Integration with QCG services

QCG-Computing

In case of installing QCG-Notification together with QCG-Computing, after finishing the QCG-Notification configuration you must edit the QCG-Computing service configuration file and update the content of the <ServiceURL> elements (in <Module xsi:type="smc:notification_wsa"> section). For e.g. if in the /etc/qcg-ntf/qcg-ntfd.xml one can find <Host>example.com<Host> and <Port>19001<Port> the <ServiceURL> must be set to http://example.com:19001/.

Note: You must restart the QCG-Computing service after updating the qcg-compd.xml configuration file.

Configuring firewall

Please have a look at   this section.

Verifying

After starting the QCG-Notification service and updating the QCG-Computing configuration try to submit a simple job and check the QCG-Computing log file to see if there are now any error messages on sending notifications, e.g.:

tail -f /var/log/qcg-comp/qcg-compd.log
INF Sep 17 16:15:01 24201 0x44b22940 [notification_ws] Sending notify message (topic = ActivityState/TerminalState/Finished, activity_id = 0544b24a-e960-400e-4910-f1a893632610, status = Finished)

Maintenance

Log management

We encourage you to configure logrotate to rotate QCG-Notification logs. This is the example configuration:

cat > /etc/logrotate.d/qcg-ntfd.logrotate << EOF
/var/log/qcg-ntf/qcg-ntfd.log 
{
    daily
    dateext
    delaycompress
    compress
    copytruncate
    rotate
    366
}
EOF

Data analysys and management

The administrators may need to view or manage data used by QCG-Notification (e.g. verify subscriptions, remove old pullpoints). The easiest way to view the data is to connect to the QCG-Notification database and select values from the particullar relations. This operation is read-only so it may be proceeded also when the QCG-Notification service is running. The more difficult thing is to modify the content of the stored data. When the service is running the operations of this type should be invoked using the provided QCG-Notification client applications. When the service is switched off the persistent data stored by QCG-Notification still can be accessed (if needed also cleaned) using the direct connection to the database.

psql -h localhost qcg-ntf qcg-ntf 
Password for user qcg-ntf: 
Welcome to psql 8.1.23, the PostgreSQL interactive terminal.
  
Type:  \copyright for distribution terms
     \h for help with SQL commands
     \? for help with psql commands
     \g or terminate with semicolon to execute query
     \q to quit

qcg-ntf=>

Attachments

  • qcg.pub Download (1.7 KB) - added by bartek 12 years ago. Public key for the Debian QCG repository