[[PageOutline]] = QCG Notification Installation in PL-Grid= Within !QosCosGrid the QCG Notification service is used for brokering notification messages about the job state changes. All instances of the QCG BES/AR services acts as the information ''Producers'' while the QCG Broker as the ''Consumer''. 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 Smoa Notification service on the same machine where the [[QCG_BES_AR|QCG BES/AR service]] is installed. IMPORTANT: :: The implementation name of the QCG Notification service is '''Smoa Notification''' and this name is used as a common in this guide. = Installation = Similarly to [[installation_QCG_BES_AR_in_PLGrid|Smoa Computing (QCG BES/AR)]], the Smoa Notification service may be installed from the provided RPMs. Assuming that the Smoa Computing service has been installed and initially configured (thus the basic dependencies are satisfied), the procedure is as follows: * ensure that the smoa_ntf user is present in a system, otherwise create it: {{{ #!div style="font-size: 90%" {{{#!sh useradd -d /opt/plgrid/var/log/smoa-ntf/ smoa_ntf }}} }}} * install PL-Grid (official) and QCG (testing) repositories, if you have not done this yet.: {{{ #!div style="font-size: 90%" {{{#!sh #QosCosGrid testing repository cat > /etc/yum.repos.d/qcg.repo << EOF [qcg] name=QosCosGrid YUM repository baseurl=http://fury.man.poznan.pl/qcg-packages/sl/x86_64/ enabled=1 gpgcheck=0 EOF #Official PL-Grid repository rpm -Uvh http://software.plgrid.pl/packages/repos/plgrid-repos-2010-2.noarch.rpm }}} }}} * install Smoa Computing using YUM Package Manager: {{{ #!div style="font-size: 90%" {{{#!sh yum install smoa-ntf }}} }}} * setup Smoa Notification database using provided script: {{{ #!div style="font-size: 90%" {{{#!sh /opt/plgrid/qcg/smoa/share/smoa-ntf/tools/smoa-ntf-install.sh Welcome to smoa-ntf installation script! This script will guide you through process of configuring proper environment for running the Smoa 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 [smoa_ntf]: User [smoa_ntf]: Password [smoa_ntf]: MojeTajneHaslo Create database? (y/n) [y]: y Create user? (y/n) [y]: y Checking for system user smoa_comp...OK Checking whether PostgreSQL server is installed...OK Checking whether PostgreSQL server is running...OK Performing installation * Creating user smoa_ntf...OK * Creating database smoa_ntf...OK * Creating database schema...OK * Checking for ODBC data source smoa_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 smoa_ntf to access database smoa_ntf. For instance: host smoa_ntf smoa_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 = == Service 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 Smoa Notification should listen as well as parameters of database connection: ''DSN'', ''User'' and ''Password''. It can be done by editing the main Smoa Notification configuration file located in: `/opt/plgrid/qcg/smoa/etc/smoa-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 '''smoa_ntf''' '''smoa_ntf''' '''smoa_ntf''' false .... }}} }}} For more information about configuration of the service please take a look at the Smoa Notification guide installed in the `/opt/plgrid/qcg/smoa/share/smoa-ntf/doc/` directory. After finishing the SMOA Notification configuration you must edit the [[installation_QCG_BES_AR_in_PLGrid#Serviceconfiguration|Smoa Computing service configuration file]] again and update the content of the `` elements (in `` section). For e.g. if in the `/opt/plgrid/qcg/smoa/etc/smoa-ntfd.xml` one can find `example.com` and `19001` the `` must be set to `http://example.com:19001/`. '''Note:''' You must restart the Smoa Computing service after updating the `smoa-compd.xml` configuration file. = Running the service = The Smoa 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/smoa-ntfd start }}} }}} The service logs can be found in: {{{ #!div style="font-size: 90%" {{{#!sh /opt/smoa/var/log/smoa-ntf/smoa-ntfd.log }}} }}} It could be then stopped with the following command: {{{ #!div style="font-size: 90%" {{{#!sh /etc/init.d/smoa-ntfd stop }}} }}} '''Note:''' `smoa-ntfd` will be started with the `smoa_ntf` user permissions. = Verifying the installation = After starting the Smoa Notification service and updating the Smoa Computing configuration try to submit a simple job and check the Smoa 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 /opt/plgrid/var/log/smoa-comp/smoa-comp.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) }}} }}} = Configuring firewall= Please have a look at [[installation_QCG_BES_AR_in_PLGrid#Configuringfirewall| this section]].