[[PageOutline]] = QCG-Notification installation using RPMS = This document describes basic procedures needed to install QCG-Notification from RPM packages and concentrates on a deployment of the service as a part of the !QosCosGrid middleware. Within !QosCosGrid the QCG-Notification service is widely used for brokering various types of notification messages related to the state of a job (e.g. including predefined status of a job or snippet from the the job's output file). In most cases it is enough that only one instance of the QCG-Notification is deployed per Administrative Domain (i.e.: not necessary one per Cluster). You can install the QCG-Notification service on the same machine where the [[http://www.qoscosgrid.org/trac/qcg-computing|QCG-Computing service]] is installed. = Installation = QCG-Notification may be installed using the Yum Package Manager from RPMs. The procedure is as follows: * if you have not done this yet, install appriopriate for your Linux distribution EPEL, PL-Grid and QCG repositories: [http://apps.man.poznan.pl/trac/qcg/wiki/Software%20repositories instruction]. * install QCG-Notification using YUM Package Manager: {{{ #!div style="font-size: 90%" {{{#!sh yum install qcg-ntf }}} }}} * setup QCG-Notification database using provided script: {{{ #!div style="font-size: 90%" {{{#!sh /usr/share/qcg-ntf/tools/qcg-ntf-install.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 /var/lib/pgsql/data/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: {{{ #!div style="font-size: 90%" {{{#!sh vim /var/lib/pgsql/data/pg_hba.conf /etc/init.d/postgresql reload }}} }}} = Configuration = == Basic configuration == The service should be ready to use "out-of-the-box", however 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/qcg-ntf/qcg-ntfd.xml`. A part of the configuration file with marked key parameters is presented below: {{{ #!div style="font-size: 90%" {{{#!xml .... 127.0.0.1 19001 true .... true qcg-ntf qcg-ntf qcg-ntf false .... }}} }}} == Optional Configuration == The following sections describes additional publisher modules that are currently exploited only in the instance of QCG-Notification deployed together with QCG-Broker (i.e. if you are installing QCG-Notification with QCG-Computing you can skip this section). === XMPP Publisher module configuration === If needed, the module for publishing notifications via XMPP protocol may be installed and enabled in the service's configuration. To install the plugin invoke: {{{ #!div style="font-size: 90%" {{{ yum install qcg-ntf-xmpp-publisher-plugin }}} }}} The relevant part of QCG-Notification configuration file should be uncommented and adjusted to the real situation. For instance, the integration with the PL-Grid XMPP server, assuming that the XMPP account equals 'someaccount' and password is 'somepass', requires the following settings: {{{ #!div style="font-size: 90%" {{{#!xml someaccount@plgrid.pl/qcg-ntf somepass TLS 7B55E421B023D4358BD9CE29F091D91C }}} }}} === SMTP Publisher module configuration === Sending notifications through e-mails is possible with QCG-Notification SMTP publisher module. To install the module use: {{{ #!div style="font-size: 90%" {{{ yum install qcg-ntf-smtp-publisher-plugin }}} }}} The SMTP module can be enabled in the QCG-Notification configuration file by uncommenting and adjusting the relevant 'Module' element. The sample XML fragment presented below is sufficient to distribute e-mails via the locally running SMTP server (eg. Postfix). {{{ #!div style="font-size: 90%" {{{#!xml smtp://localhost:25 }}} }}} == Further reading == For more information about configuration of the service please take a look at the [[/wiki/technicalGuideAndManual#configuration|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: {{{ #!div style="font-size: 90%" {{{#!sh /etc/init.d/qcg-ntfd start }}} }}} The service logs can be found in: {{{ #!div style="font-size: 90%" {{{#!sh /var/log/qcg/qcg-ntf/qcg-ntfd.log }}} }}} It could be then stopped with the following command: {{{ #!div style="font-size: 90%" {{{#!sh /etc/init.d/qcg-ntfd stop }}} }}} '''Note:''' `qcg-ntfd` will be started with the `qcg_ntf` user permissions. = Integration with QCG services and other interested parties = QCG-Notification simplifyies cooperation of the two key !QosCosGrid services, i.e. QCG-Broker and QCG-Computing, as well as it offers notification capabilities to the external components. The integration of QCG-Notification with these entities is not problematic, however it meet some restrictions: * QCG-Notification has to be able to initiate connections with QCG-Broker. * QCG-Computing has to be able to initiate connections with QCG-Notification. * QCG-Broker has to be able to initiate connections with QCG-Notification. * If XMPP plugin is used, QCG-Notification should be able to connect to the XMPP server. * If SMTP plugin is used, QCG-Notification should be able to connect to the SMTP server. == QCG-Computing == After finishing the QCG-Notification configuration you must edit the QCG-Computing service configuration file and update the content of the `` elements (in `` section). For e.g. if in the `/etc/qcg/qcg-ntf/qcg-ntfd.xml` one can find `example.com` and `19001` the `` 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 == QCG-Notification requires only one TCP port to be open for incoming connections. By default it should be port 19001. Note that the QCG-Notification service may publish notifications using various protocols and connect to many notification consumer services deployed on different machines and listening on different ports. Within the PL-Grid, the QCG-Notification sends notifications via HTTP/HTTPS to the QCG-Broker service listening on a predefined port as well as it may use XMPP and SMTP protocols to distribute XMPP and e-mail messages. These all remarks should be reflected in the firewall configuration. Please have a look also at [[https://apps.man.poznan.pl/trac/qcg-computing/wiki/InstallingUsingRPMS#Firewallconfiguration|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.: {{{ #!div style="font-size: 90%" {{{#!sh tail -f /var/log/qcg/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 == You may also wish to install logrotate configuration for QCG-Notification: {{{ #!div style="font-size: 90%" {{{#!sh yum install qcg-ntf-logrotate }}} }}} == Nagios probes == See: [http://www.qoscosgrid.org/trac/qcg-notification/wiki/NagiosProbes Nagios probes for QCG-Notification] == 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. {{{ #!div style="font-size: 90%" {{{#!sh 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=> }}} }}}