(Click to open topic with navigation)
You must deploy Moab Web Services on the same host as Moab Server (Moab Server Host). For documentation clarity, these instructions refer to the shared host for Moab Server and MWS as the MWS Server Host.
This topic contains instructions on how to install Moab Web Services (MWS).
In this topic:
If your site is running firewall software on its hosts, you will need to configure the firewall to allow connections to the necessary ports.
In this section:
2.5.1.A Open the Tomcat Port (8080)
On the MWS Server Host, do the following:
[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 8080 -j ACCEPT [root]# iptables-restore < /tmp/iptables.mod [root]# service iptables save
2.5.1.B Open the MWS MongoDB Database Port (27017)
Depending on your system configuration, your MongoDB databases may not be installed on the same host as their corresponding component servers. For example, you may choose to install the MWS MongoDB database on the same host where you have installed other MongoDB databases instead of on the MWS Server Host.
Do the following, as needed:
[root]# iptables-save > /tmp/iptables.mod [root]# vi /tmp/iptables.mod Add the following line immediately *before* the line matching # "-A INPUT -j REJECT --reject-with icmp-host-prohibited" -A INPUT -p tcp --dport 27017 -j ACCEPT [root]# iptables-restore < /tmp/iptables.mod [root]# service iptables save
2.5.2 Install Dependencies, Packages, or Clients
In this section:
Install the Linux x64 RPM version of Oracle® Java® 8 Runtime Environment.
Oracle Java 8 Runtime Environment is the recommended Java environment, but Oracle Java 7 is also supported. All other versions of Java, including OpenJDK/IcedTea, GNU Compiler for Java, and so on cannot run MWS.
On the MWS Server Host, do the following:
[root]# rpm -Uh <URL>
Install Tomcat 7.
Tomcat 7 is required to run MWS 9.0 and later. MWS 9.0 will not run on Tomcat 6.
On the MWS Server Host, do the following:
[root]# yum install tomcat
If installing on RHEL 6, tomcat may not be found in the standard RHEL distribution repositories.
One way to overcome this problem is to install the missing dependencies from EPEL or other reputable repositories. For example (for the current RHEL 6 repositories):
[root]# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm [root]# yum install yum-utils [root]# yum-config-manager --disable epel [root]# yum install --enablerepo=epel tomcat
To install and enable MongoDB, do the following on the MWS Server Host:
[root]# cat > /etc/yum.repos.d/mongodb.repo <<End-of-file [mongodb] name=MongoDB Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 gpgcheck=0 enabled=1 exclude=mongodb-org mongodb-org-server End-of-file [root]# yum install mongo-10gen-server
There may be a short delay (approximately three minutes) for Mongo to start the first time.
[root]# chkconfig mongod on [root]# service mongod start
The passwords used below (secret1, secret2, and secret3) are examples. Choose your own passwords for these users.
[root]# mongo > use admin; > db.addUser("admin_user", "secret1"); > db.auth ("admin_user", "secret1"); > use moab; > db.addUser("moab_user", "secret2"); > db.addUser("mws_user", "secret3", true); > use mws; > db.addUser("mws_user", "secret3"); > exit
Because the admin_user has read and write rights to the admin database, it also has read and write rights to all other databases. See Control Access to MongoDB Instances with Authentication for more information.
[root]# vi /etc/mongod.conf auth = true [root]# service mongod restart
You must complete the tasks to install the dependencies, packages, or clients before installing MWS Server. See 2.5.2 Install Dependencies, Packages, or Clients.
If your configuration uses firewalls, you must also open the necessary ports before installing the MWS Server. See 2.5.1 Open Necessary Ports .
On the MWS Server Host, do the following:
[root]# service moab start
Create the MWS home directory and subdirectories.
See Configuration in the Moab Web Services Administrator Guide for more information.
The default location for the MWS home directory is /opt/mws. These instructions assume the default location.
Do the following:
[root]# mkdir -p \ /opt/mws/etc/mws.d \ /opt/mws/hooks \ /opt/mws/log \ /opt/mws/plugins \ /opt/mws/spool/hooks \ /opt/mws/utils [root]# chown -R tomcat:tomcat /opt/mws [root]# chmod -R 555 /opt/mws [root]# chmod u+w \ /opt/mws/log \ /opt/mws/plugins \ /opt/mws/spool \ /opt/mws/spool/hooks \ /opt/mws/utils
The variable marked <version> is the desired version of the suite; for example, 9.0.2.
[root]# mkdir /tmp/mws-install
[root]# cd /tmp/mws-install
[root]# tar xvzf $HOME/Downloads/mws-9.0.2.tar.gz
Copy the extracted utility files to the utility directory created in the previous step and give the tomcat user ownership of the directory.
[root]# cd /tmp/mws-install/mws-9.0.2/utils
[root]# cp * /opt/mws/utils
[root]# chown tomcat:tomcat /opt/mws/utils/*
Connect Moab to MongoDB.
The USEDATABASE parameter is unrelated to the MongoDB configuration.
MONGOSERVER <host>[:<port>]
If your MONGOSERVER host is set to anything other than localhost, edit the /etc/mongod.conf file on the MongoDB server host and either comment out any bind_ip parameter or set it to the correct IP address.
# Listen to local interface only. Comment out to listen on all interfaces. #bind_ip=127.0.0.1
MONGOUSER moab_user MONGOPASSWORD secret2
[root]# service moab restart [root]# mdiag -S | grep Mongo Mongo connection (localhost) is up (credentials are set)
Secure communication using secret keys.
[root]# service moab stop [root]# dd if=/dev/urandom count=24 bs=1 2>/dev/null | base64 > /opt/moab/etc/.moab.key [root]# chown root:root /opt/moab/etc/.moab.key [root]# chmod 400 /opt/moab/etc/.moab.key [root]# service moab start
[root]# service moab stop [root]# echo "MESSAGEQUEUESECRETKEY $(dd if=/dev/urandom count=16 bs=1 2>/dev/null | base64)" >> /opt/moab/etc/moab-private.cfg [root]# service moab start
If MWS is configured to encrypt the message queue and Moab is not (or vice versa), then MWS will ignore the messsages from Moab. Furthermore, all attempts to access the MWS service resource will fail.
[root]# mdiag -S|grep 'ZeroMQ MWS' ZeroMQ MWS connection is bound on port 5570 (encryption is on)
Set up the MWS configuration files. In the extracted directory are several configuration files.
Copy the configuration files into place and grant the tomcat user ownership.
[root]# cd /tmp/mws-install/mws-9.0.2
[root]# cp mws-config.groovy /opt/mws/etc
[root]# cp mws-config-hpc.groovy /opt/mws/etc/mws.d
[root]# chown tomcat:tomcat /opt/mws/etc/mws-config.groovy /opt/mws/etc/mws.d/mws-config-hpc.groovy
If MWS is configured to encrypt the message queue and Moab is not (or vice versa), then the messages from Moab will be ignored. Furthermore, all attempts to access the MWS service resource will fail.
[root]# vi /opt/mws/etc/mws-config.groovy // Replace <ENTER-KEY-HERE> with the contents of /opt/moab/etc/.moab.key. moab.secretKey = "<ENTER-KEY-HERE>" moab.server = "localhost" moab.port = 42559 // Replace <ENTER-KEY-HERE> with the value of MESSAGEQUEUESECRETKEY in /opt/moab/etc/moab-private.cfg. moab.messageQueue.secretKey = "<ENTER-KEY-HERE>" // Change these to be whatever you like. auth.defaultUser.username = "moab-admin" auth.defaultUser.password = "changeme!"
If you do not change auth.defaultUser.password, your MWS will not be secure (because anyone reading these instructions would be able to log into your MWS). Here are some tips for choosing a good password.
[root]# vi /opt/mws/etc/mws.d/mws-config-hpc.groovy mam.secretKey = "<ENTER-KEY-HERE>" mam.server = "localhost" mam.port = 7112
You can configure only one authentication method in /opt/mws/etc/mws-config.groovy—LDAP or PAM, but not both. If you have configured both LDAP and PAM, MWS defaults to using LDAP.
If you need multiple authentication methods, you must add them to your local PAM configuration. See your distribution documentation for details.
ldap.server = "192.168.0.5" ldap.port = 389 ldap.baseDNs = ["dc=acme,dc=com"] ldap.bindUser = "cn=Manager,dc=acme,dc=com" ldap.password = "*****" ldap.directory.type = "OpenLDAP Using InetOrgPerson Schema"
This is just an example LDAP connection. Be sure to use the appropriate domain controllers (dc) and common names (cn) for your environment.
If you followed the Adaptive Computing tutorial, Setting Up OpenLDAP on CentOS 6, your ldap.directory.type should be set to "OpenLDAP Using InetOrgPerson Schema." However, the use of other schemas is supported. For more information see LDAP Configuration Using /opt/mws/etc/mws-config.groovy.
To see how to configure a secure connection to the LDAP server, see Securing the LDAP Connection.
pam.configuration.service = "login"
This is just an example PAM configuration file name. Make sure you specify the name of the configuration file you want MWS to use.
Configuring MWS to authenticate via PAM using local passwd and shadow files presents a significant security risk. To make local authentication work, you would need to run Tomcat as root or give Tomcat read access to /etc/shadow. This configuration is highly discouraged and is not supported by Adaptive Computing.
The recommended approach is to configure PAM and NSS to authenticate against NIS or LDAP. For example, to make sure users with both local and NIS accounts are authenticating against NIS, configure the nsswitch.conf file as shown below.
passwd: nis files shadow: nis files group: nis files
For more information about PAM configuration with MWS, see PAM (Pluggable Authentication Module) Configuration Using /opt/mws/etc/mws-config.groovy.
... grails.mongo.username = "mws_user" grails.mongo.password = "secret3"
[root]# chmod 400 /opt/mws/etc/mws-config.groovy /opt/mws/etc/mws.d/mws-config-hpc.groovy
Add the following lines to the end of /etc/tomcat/tomcat.conf.
CATALINA_OPTS="-DMWS_HOME=/opt/mws -Xms256m -Xmx3g -XX:MaxPermSize=384m -Dfile.encoding=UTF8" JAVA_HOME="/usr/java/latest"
MaxPermSize is ignored using Java 8; and therefore can be omitted.
[root]# chkconfig tomcat on
[root]# service tomcat stop
[root]# cp /tmp/mws-install/mws-9.0.2/mws.war /usr/share/tomcat/webapps
[root]# service tomcat start
Click to enlarge |
If you encounter problems, or if the application does not seem to be running, see the steps in 4.2 Moab Web Services Issues.
Related Topics