(Click to open topic with navigation)
This topic contains instructions on how to install and start Moab Accounting Manager (MAM).
Perform the following in order:
The first step is determining the number of different hosts (physical machines) required for your MAM installation.
Your MAM installation includes:
Each of these components can be installed on their own hosts (meaning the actual physical machine) or can be combined on same hosts. For example, the MAM Database can be installed on the same host as the MAM Server. Or the MAM Server may be installed on the same host on which you installed the Moab Server.
Once you have determined which components are installed on which hosts, complete the rest of the instructions for the MAM installation.
The instructions that follow in this topic will use the term host after each component to indicate the physical machine on which the component is installed (for example, MAM Server Host and MAM Database Host). Depending on your configuration, the host may refer to the component installed on its own machine or installed on the same machine as another component.
If your site is running firewall software on its hosts, you will need to configure the firewall to allow connections to the necessary ports.
Location | Ports | Functions | When Needed |
---|---|---|---|
MAM Server Host | 7112 | MAM Server Port | If you will be installing the MAM Server on a different host from where you installed the Moab Server or you will be installing the MAM Clients on other hosts |
MAM GUI Host | 443 | HTTPS Port | If using the MAM GUI |
MAM Web Services Host | 443 | HTTPS Port | If using MAM Web Services |
MAM Database Host | 5432 | MAM PostgreSQL Server Port | If you will be installing the MAM Database on a different host from the MAM Server |
See 2.11 Opening Ports in a Firewall for general instructions and an example of how to open ports in the firewall.
2.4.3 Install and Initialize PostgreSQL Server
Moab Accounting Manager uses a database for transactions and data persistence. The PostgreSQL database may be installed on a different host from the MAM Server; however, it is often convenient to install them on the same host. For example, the PostgreSQL database may be installed on:
On the host where the MAM PostgreSQL database will reside, do the following:
Install and initialize the PostreSQL Server.
[root]# zypper install postgresql-server [root]# systemctl start postgresql.service
Edit or add a "host" line in the pg_hba.conf file for the interface from which the MAM Server will be connecting to the database and ensure that it specifies a secure password-based authentication method (for example, md5).
[root]# vi /var/lib/pgsql/data/pg_hba.conf # Replace 127.0.0.1 with the IP address of the MAM Server Host if the # MAM PostgreSQL server is on a separate host from the MAM server. host all all 127.0.0.1/32 md5 host all all ::1/128 md5 ---
[root]# vi /var/lib/pgsql/data/postgresql.conf # Replace <mam-server-host> with the TCP/IP address on which the database server is to listen for connections # from the MAM server. This will normally be the hostname or ip address of the MAM Database Host. listen_addresses = '<mam-database-host>'
[root]# systemctl enable postgresql.service [root]# systemctl restart postgresql.service
2.4.4 Install Dependencies, Packages, or Clients
Use the following instructions to install the required Moab Accounting Manager dependencies, packages, or clients.
Depending on your configuration, the MAM Server Host and the MAM GUI Host may be installed on the same host. The MAM Client Host is automatically installed on the same host as the MAM Server Host; however, you can also install the MAM Client Host on any other hosts on which you want to have the MAM client commands available to users or administrators.
[root]# zypper install gcc lsb-release perl-Config-Tiny perl-Crypt-CBC perl-Crypt-DES perl-Crypt-DES_EDE3 perl-Digest-HMAC perl-Error perl-JSON perl-Log-Dispatch perl-Log-Dispatch-FileRotate perl-Log-Log4perl perl-Params-Validate perl-XML-LibXML perl-YAML
[root]# zypper install postgresql postgresql-devel libpq5 perl-DBD-Pg perl-Date-Manip perl-DBI
perl-DBD-Pg is provided in the SLES 12 devel:languages:perl repository, but for some reason it is not included in the SLES 12 SP1 devel:languages:perl. So if you are installing on SLES 12 SP1, you can install it from the SLES 12 devel:languages:perl repository.
[root]# zypper --plus-repo http://download.opensuse.org/repositories/devel:/languages:/perl/SLE_12 install perl-DBD-Pg
[root]# zypper install apache2 perl-CGI perl-CGI-Session
[root]# zypper install apache2 apache2-mod_perl
[root]# zypper install libopenssl-devel perl-Term-ReadLine-Gnu perl-Term-ReadKey
If any of the Perl module packages fail to install or are unavailable for your system, you can install it from CPAN by running cpan MODULENAME where MODULENAME is the respective perl module name.
2.4.5 (Optional) Build a Custom RPM
Do the following:
[root]# zypper install rpm-build
On the MAM Server Host, do the following:
[root]# useradd -m mam [root]# su - mam [mam]$ mkdir src [mam]$ cd src
[mam]$ tar -zxvf mam-9.1.1.tar.gz [mam]$ cd mam-9.1.1
[mam]$ ./configure
[mam]$ make
Depending on your configuration, you may need to replace "make" with a make command that includes additional functionality. Specifically:
[mam]$ exit
[root]# cd ~mam/src/mam-9.1.1
[root]# make install
Depending on your configuration, you may need to replace "make install" with a make command that includes additional functionality. Specifically:
PostgreSQL should have previously been installed using the instructions in 2.1 Preparing for Manual Installation.
[root]# su - postgres
[postgres]$ psql
create database mam;
create user mam with password 'changeme!';
\q
[postgres]$ exit
The password you define must be synchronized with the database.password value in /opt/mam/etc/mam-server.conf
[root]# vi /opt/mam/etc/mam-server.conf database.password = changeme!
[root]# su - mam
[mam]$ cd src/mam-9.1.1
[mam]$ psql mam < hpc.sql
[mam]$ exit
[root]# systemctl enable mam.service [root]# systemctl start mam.service
If you plan to use the web GUI, then on the MAM GUI Host, do the following:
[root]# a2enflag SSL [root]# cp /etc/apache2/vhosts.d/vhost-ssl.template /etc/apache2/vhosts.d/mam-ssl.conf [root]# vi /etc/apache2/vhosts.d/mam-ssl.conf # Edit the SSLCertificate lines to coincide with the certificates you will produce in the next step SSLCertificateFile /etc/apache2/ssl.crt/server.crt SSLCertificateKeyFile /etc/apache2/ssl.key/server.key <Directory "/srv/www/cgi-bin"> Options ExecCGI AddHandler cgi-script .cgi AllowOverride All Require all granted </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
Alternatively, if your network domain can be secured from man-in-the-middle attacks, you could use a self-signed certificate.
If your configuration uses self-signed certificates, do the following:
[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
[root]# systemctl enable apache2.service [root]# systemctl restart apache2.service
2.4.8 Configure MAM Web Services
If you plan to use MAM Web Services, then on the MAM Web Services Host, do the following:
Edit the SSL virtual host definition in ssl.conf to include the mamws location. For example:
[root]# a2enflag SSL [root]# a2enmod perl # Do not repeat the following copy step if performed previously on the same host when configuring the web server [root]# cp /etc/apache2/vhosts.d/vhost-ssl.template /etc/apache2/vhosts.d/mam-ssl.conf [root]# vi /etc/apache2/vhosts.d/mam-ssl.conf # Place the following within the 443 VirtualHost definition PerlOptions +Parent PerlSwitches -Mlib=/opt/mam/lib PerlModule MAM::WSResponseHandler PerlModule MAM::WSAuthenHandler <Location /mamws> SetHandler perl-script PerlResponseHandler MAM::WSResponseHandler Options +ExecCGI AuthName MAM PerlAuthenHandler MAM::WSAuthenHandler Require valid-user AllowOverride All </Location>
Alternatively, if your network domain can be secured from man-in-the-middle attacks, you could use a self-signed certificate. Often this does not require any additional steps since in many distributions, such as Red Hat, the Apache SSL configuration provides self-signed certificates by default.
If your configuration uses self-signed certificates, do the following:
[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
[root]# systemctl enable apache2.service [root]# systemctl restart apache2.service
If you plan to use the web GUI, then on the MAM Server Host, do the following:
[root]# su - mam [mam]$ mam-set-password [mam]$ exit
2.4.10 Access MAM Web Services
If you plan to use MAM web services, then on a MAM Client Host, do the following:
[root]# su - mam [mam]$ mam-set-password [mam]$ exit
Make a call to web services.
[root]# curl -k -X GET --basic -u mam:changeme! 'https://<mam-web-services-host>/mamws/system'
Alternatively, for queries, you can use the browser to access the URL. For example: 'https://<mam-web-services-host>/mamws/system'.
2.4.11 Configure Moab Workload Manager to Use Moab Accounting Manager
If integrating with Moab Workload Manager, do the following:
Do one of the following:
[root]# vi /opt/moab/etc/moab.cfg
AMCFG[mam] TYPE=MAM HOST=<mam_server_host>
Customize additionally as needed. See Accounting, Charging, and Allocation Management in the Moab Workload Manager Administrator Guide
[root]# vi /opt/moab/etc/moab-private.cfg
CLIENTCFG[AM:mam] KEY=<MAMSecretKey>
[root]# vi /opt/moab/etc/moab.cfg AMCFG[mam] TYPE=NATIVE
On the Moab Server Host, follow the instructions in 2.4.4 Install Dependencies, Packages, or Clients and 2.4.6 Install MAM Server; with the following exceptions:
systemctl restart moab.service
2.4.12 Initialize Moab Accounting Manager
You will need to initialize Moab Accounting Manager to function in the way that is most applicable to the needs of your site. See Initial Setup in the Moab Accounting Manager Administrator Guide to set up Moab Accounting Manager for your desired accounting mode.
Related Topics