Installing Moab Accounting Manager

Installing Moab Accounting Manager

These instructions describe how to install and start Moab Accounting Manager (MAM).

To install Moab Accounting Manager

  1. Download the latest MAM build (mam-<version>.tar.gz) from the Adaptive Computing website.
  2. Create a user called moab, and switch to that user.
  3. [root]# useradd -m moab

    [root]# su - moab

  4. Untar the MAM tarball as the user moab in a directory with write permissions for the user.
  5. [moab]$ tar -zxvf mam-7.2.3.tar.gz

  6. Navigate to mam-7.2.3.
  7. [moab]$ cd mam-7.2.3

  8. Configure, compile, and install the software.
  9. [moab]$ ./configure --with-db-type=mysql

    [moab]$ make

    [moab]$ exit

    [root]# cd /home/moab/mam-7.2.3

    [root]# make install

  10. Enable support for transactions.
  11. [root]# nano /etc/my.cnf

     

    ## Place this in the [mysqld] section:

    default-storage-engine = INNODB

  12. Start the mysql daemon and configure it to start automatically on boot up.

    RedHat-based system:

  13. [root]# chkconfig mysqld on

    [root]# service mysqld restart

    SuSE-based system:

    [root]# chkconfig mysql on

    [root]# service mysql restart

  14. Create a database called mam and grant database privileges to the moab user.

    [root]# mysql

     

    mysql> create database mam;

    mysql> grant all on *.* to 'moab'@'localhost' identified by 'changeme';

    mysql> exit

    The password you define must be synchronized with the database.password value in /opt/mam/etc/goldd.conf.

    [moab]$ nano /opt/mam/etc/goldd.conf

     

    database.password = changeme

  15. As the mysql user moab, import the hpc.sql file into the mam database.
  16. [root]# mysql mam -u moab -p < hpc.sql

  17. Source the appropriate environment file to add the MAM commands to your current PATH.
  18. [root]# cp etc/profile.d/*.sh /etc/profile.d

    [root]# . /etc/profile.d/mam.sh

  19. Copy the appropriate system startup script to /etc/init.d and start the Moab Accounting Manager service. You may also want to configure MAM to start up automatically at system boot as appropriate for your distribution.

    RedHat-based system:

  20. [root]# cp etc/init.d/mam.redhat /etc/init.d/mam

    [root]# chkconfig --add mam

    [root]# service mam start

    SuSE-based system:

    [root]# cp etc/init.d/mam.suse /etc/init.d/mam

    [root]# chkconfig --add mam

    [root]# service mam start

  21. Copy the auto-generated secret key from the token.value parameter in the /opt/mam/etc/site.conf file. Add it to the moab-private.cfg file as the value of the CLIENTCFG KEY attribute so that Moab Workload Manager can communicate with Moab Accounting Manager. Restart Moab Workload Manager.
  22. [root]# nano /opt/moab/etc/moab-private.cfg
     
    CLIENTCFG[AM:mam] KEY=<MAMSecretKey> AUTHTYPE=HMAC64
     
    [root]# service moab restart
  23. If you use a SuSE-based system, edit the Apache configure files to use SSL and CGI and to define aliases.
  24. SuSE-based system:

    [root]# nano /etc/sysconfig/apache2

     

    APACHE_SERVER_FLAGS="-DSSL"

    ### Reword per the per-OS variances below

  25. As root, add or edit the SSL virtual host definition as appropriate for your environment. To do so, configure the cgi-bin directory in ssl.conf. Below the cgi-bin directory element, create an alias for /cgi-bin pointing to your cgi-bin directory. If you chose to install to a cgi-bin sub-directory, you might want to create an alias for that as well. Also, add index.cgi to the DirectoryIndex so you can use the shorter sub-directory name.

    RedHat-based system:

    [root]# nano /etc/httpd/conf.d/ssl.conf

     

    <Directory "/var/www/cgi-bin">

    ## Add these lines

      Options ExecCGI

      AddHandler cgi-script .cgi

      AllowOverride All

      Order allow,deny

      Allow from all

    </Directory>

     

    # Aliases for /cgi-bin

    Alias /cgi-bin/ /var/www/cgi-bin/

    Alias /mam/ /var/www/cgi-bin/mam/

     

    # Make shorter sub-dir name available

    DirectoryIndex index.cgi

    SuSE-based system:

    [root]# cp /etc/apache2/vhosts.d/vhost-ssl.template

    /etc/apache2/vhosts.d/mam-ssl.conf

    [root]# nano /etc/apache2/vhosts.d/mam-ssl.conf

     

    <Directory "/srv/www/cgi-bin">

    ## Add these lines

      Options ExecCGI

      AddHandler cgi-script .cgi

      AllowOverride All

      Order allow,deny

      Allow from all

    </Directory>

     

    # Aliases for /cgi-bin

    Alias /cgi-bin/ /srv/www/cgi-bin/

    Alias /mam/ /srv/www/cgi-bin/mam/

     

    # Make shorter sub-dir name available

    DirectoryIndex index.cgi

  26. For the highest security, it is recommended that you install a public key certificate that has been signed by a certificate authority. The exact steps to do this are specific to your distribution and the chosen certificate authority. An overview of this process for CentOS 5 is documented here. If you are using self-signed certificates, some Mozilla Firefox users might experience certificate-related difficulties accessing MAM within Moab Viewpoint for the first time.

    Alternatively, if your network domain can be secured from man-in-the-middle attacks, you culd use a self-signed certificate. Often this does not require any additional steps since in many distributions, such as RedHat, the Appache SSL configuration provides self-signed certificates by default.

    The following steps assume you are using self-signed certificates:

    Create self-signed SSL certificate and key files. Some distributions such as RedHat ship with ready-made certificates.

    For SuSE-based systems:

    [root]# cd /etc/apache2
    [root]# openssl genrsa -out ssl.key/server.key 1024
    [root]# openssl req -new -key ssl.key/server.key -x509 -out ssl.crt/server.crt
  27. Start or restart the HTTP server daemon.

    RedHat-based system:

  28. [root]# service httpd restart

    SuSE-based system:

    [root]# service apache2 restart

  29. Create a password for the user moab to be used with the MAM Web GUI.
  30. [root]# su - moab

    [moab]$ gchpasswd

You can now access the GUI at https://<hostname>/cgi-bin/mam by logging in as moab and using the password you set.

You can define users, accounts, charge rates, etc., as needed for your site (for more information, see the "Getting Started" section of the Moab Accounting Manager Administrator Guide). An initialization script has been provided that can set up a sample initial environment (with some dummy users, accounts, charge rates, etc.) To initialize your database with this sample data, execute the script as the moab user:

[moab]$ mam-7.2.3/test/hpc-allocation-enforcement.sh

Related topics 

© 2014 Adaptive Computing