(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 you installed the Moab Server.
If your configuration will have the MAM PostgresSQL database on the same host as the Insight PostgreSQL database, the MAM PostgreSQL database must be same version as the Insight PostgreSQL database. See 2.4 Installing Moab Accounting Manager for supported database versions.
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 reflect installing on a host (again, meaning the physical machine). For example, MAM Server Host and MAM Database Host. Depending on your configuration, Host may refer to as 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.
Do the following as needed:
[root]# iptables-save > /tmp/iptables.mod [root]# vi /tmp/iptables.mod # Add the following lines immediately *before* the line matching # "-A INPUT -j REJECT --reject-with icmp-host-prohibited" -A INPUT -p tcp --dport 7112 -j ACCEPT [root]# iptables-restore < /tmp/iptables.mod [root]# service iptables save
[root]# iptables-save > /tmp/iptables.mod [root]# vi /tmp/iptables.mod # Add the following lines immediately *before* the line matching # "-A INPUT -j REJECT --reject-with icmp-host-prohibited" -A INPUT -p tcp --dport 443 -j ACCEPT [root]# iptables-restore < /tmp/iptables.mod [root]# service iptables save
[root]# iptables-save > /tmp/iptables.mod [root]# vi /tmp/iptables.mod # Add the following lines immediately *before* the line matching # "-A INPUT -j REJECT --reject-with icmp-host-prohibited" -A INPUT -p tcp --dport 5432 -j ACCEPT [root]# iptables-restore < /tmp/iptables.mod [root]# service iptables save
2.4.3 Install and Initialize the PostgreSQL Server
Moab Accounting Manager uses a database for transactions and data persistence.
The MAM PostgreSQL database may be installed on:
On the host where the MAM PostgreSQL database will reside, do the following:
These instructions assume you will be installing the MAM PostgreSQL database on a different host from where the Insight PostgreSQL database will reside.
If you wish to install both the MAM and the Insight PostgreSQL databases on the same host, different instructions are required. For example, you will need to enable the Insight-specific postgresql RPM repo by following the RPM instructions to prepare the host (see 3.2 Preparing the Host – Typical Method or 3.4 Preparing the Host – Offline Method) and you will need to modify the MAM PostgreSQL install instructions to reflect the different version of PostgreSQL required by Insight (see 3.10.2.C Install PostgreSQL for an example of how to install PostgreSQL for Insight).
[root]# yum install postgresql-server [root]# service postgresql initdb
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 interface name from which the MAM server # will be connecting to the database. listen_addresses = '<mam-server-host>' ---
[root]# chkconfig postgresql on [root]# service postgresql restart
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]# yum install gcc redhat-lsb-core perl rrdtool perl-Config-Tiny perl-Crypt-CBC perl-Crypt-DES perl-Crypt-DES_EDE3 perl-Digest-HMAC perl-Error perl-Log-Dispatch-FileRotate perl-Log-Log4perl perl-XML-LibXML
If installing on RHEL, some packages may not be found in the standard RHEL distribution repositories.
[root]# rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm [root]# yum install yum-utils [root]# yum-config-manager --disable epel [root]# yum install --enablerepo=epel,rhel-7-server-optional-rpms gcc redhat-lsb-core perl rrdtool perl-Config-Tiny perl-Crypt-CBC perl-Crypt-DES perl-Crypt-DES_EDE3 perl-Digest-HMAC perl-Error perl-Log-Dispatch-FileRotate perl-Log-Log4perl perl-XML-LibXML
[root]# yum install --skip-broken gcc redhat-lsb-core perl rrdtool perl-Config-Tiny perl-Crypt-CBC perl-Crypt-DES perl-Crypt-DES_EDE3 perl-Digest-HMAC perl-Error perl-Log-Dispatch-FileRotate perl-Log-Log4perl perl-XML-LibXML perl-CPAN [root]# cpan YAML Config::Tiny Log::Log4perl Log::Dispatch::FileRotate Compress::Zlib
You may need to run the cpan command more than once for it to complete successfully.
[root]# yum install postgresql postgresql-libs perl-DBD-Pg perl-Date-Manip perl-Time-HiRes perl-DBI
[root]# yum install httpd mod_ssl perl-CGI perl-CGI-Session
[root]# yum install perl-suidperl perl-Term-ReadLine-Gnu perl-TermReadKey
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
If you want to build a custom RPM, do the following:
[root]# yum install rpm-build
The variable marked <version> indicates the build's version.
On the MAM Server Host, do the following:
[root]# useradd -m mam [root]# su - mam [mam]$ mkdir src [mam]$ cd src
The variable marked <version> indicates the build's version.
[mam]$ tar -zxvf mam-9.0.2.tar.gz
[mam]$ cd mam-9.0.2
[mam]$ ./configure
[mam]$ make
If you only need to install the clients on a particular system, replace make with make clients-only. If you only need to install the web GUI on a particular system, replace make with make gui-only.
[mam]$ exit
[root]# cd ~mam/src/mam-9.0.2
[root]# make install
If you only need to install the clients on a particular system, replace make install with make install-clients-only. If you only need to install the web GUI on a particular system, replace make install with make install-gui-only.
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.0.2
[mam]$ psql mam < hpc.sql
[mam]$ exit
[root]# chkconfig --add mam [root]# service mam start
If you plan to use the web GUI, then on the MAM GUI Host, do the following:
[root]# vi /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
[root]# getenforce Enforcing
SELinux can vary by version and architecture and that these instructions may not work in all possible environments.
If you used the --prefix=<prefix> configuration option when you configured Moab Accounting Manager, you must replace references to /opt/mam in the example below with the <prefix> you specified. See 2.14 Moab Accounting Manager Configuration Options.
[root]# cat > mamgui.te <<EOF module mamgui 1.0; require { type httpd_sys_script_t; type port_t; class capability setuid; class tcp_socket name_connect; } allow httpd_sys_script_t port_t:tcp_socket name_connect; allow httpd_sys_script_t self:capability setuid; EOF [root]# checkmodule -M -m -o mamgui.mod mamgui.te [root]# semodule_package -m mamgui.mod -o mamgui.pp [root]# semodule -i mamgui.pp [root]# setenforce 0 [root]# chcon -v -t httpd_sys_content_t /opt/mam/log [root]# setenforce 1
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, no action is required; Red Hat ships with ready-made certificates.
[root]# chkconfig httpd on [root]# service httpd restart
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.9 Configure Moab Workload Manager to Use Moab Accounting 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:
service moab restart
2.4.10 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