Installing Moab Web Services

Installing Moab Web Services

These instructions describe how to deploy Moab Web Services (MWS) to a Tomcat server.

To install Moab Web Services

You must deploy Moab Web Services on the same server as Moab Workload Manager.

  1. Make sure that you have first installed and configured Moab Workload Manager as desired (for details, see Installing Moab Workload Manager).
  2. Generate a secret key to be used for communication between MWM and MWS.
  3. Here is a suggested script that you can use to generate the key:

    dd if=/dev/urandom count=18 bs=1 2>/dev/null | base64 > /opt/moab/etc/.moab.key

    chown root /opt/moab/etc/.moab.key

    chmod 400 /opt/moab/etc/.moab.key

    ln -f /opt/moab/etc/.moab.key /opt/moab/.moab.key

  4. Start MWM.
  5. service moab start

  6. Install MongoDB version 2.0.1 or later on the MWM server using packages (recommended) or manual installation.
  7. Installation method Instructions
    Packages (recommended)

    Install the packages (available from the Mongo-provided repositories for CentOS and Fedora or Ubuntu and Debian).

    After installing the packages, start MongoDB and arrange for it to start automatically during server startup.

    • For CentOS and Fedora, here are some examples:
    • /sbin/chkconfig mongod on

      /etc/init.d/mongod start

    • For Ubuntu and Debian examples, see these instructions.
    Manual (not recommended)

    Follow these instructions.

    Be sure to start the Mongo server (mongod) after installation and arrange for it to start automatically during server startup (for example, by writing and registering an /etc/init.d script).

  8. Install and enable the 64-bit version of Oracle Java SE 6 JRE. For example:
  9. sh jre-6u33-linux-x64-rpm.bin

    rm -f /usr/bin/java

    ln -s /etc/alternatives/java /usr/bin/java

    /usr/sbin/alternatives --install /usr/bin/java java /usr/java/latest/bin/java 1

    /usr/sbin/alternatives --set java /usr/java/latest/bin/java

    You can verify the Java installation by running the following command:

    java -version

    The output should look similar to this:

    java version "1.6.0_33"

    Java(TM) SE Runtime Environment (build 1.6.0_33-b03)

    Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)

  10. Create the MWS home directory (for more information, see the "Configuration" section of the Moab Web Services Reference Guide), and the etc, hooks, plugins, and log subdirectories. You will need to give the Tomcat user "read" access to all directories and "write" access to the plugins and log directories.
  11. The default location for the MWS home directory is /opt/mws. These instructions assume the default location.

    Here is an sample script for this setup:

    mkdir -p /opt/mws/etc /opt/mws/hooks /opt/mws/plugins /opt/mws/log

    chown -R tomcat /opt/mws # Depending on your OS, the Tomcat username might be tomcat6.

    chmod -R 555 /opt/mws

    chmod u+w /opt/mws/plugins /opt/mws/log

  12. Extract the contents of the MWS download tarball into a temporary directory. For example:
  13. mkdir /tmp/mws-install

    cd /tmp/mws-install

    tar xvzf $HOME/Downloads/mws-7.1.0.tar.gz

    cd /tmp/mws-install/mws-7.1.0

  14. Set up the MWS configuration file by doing the following:
    1. Copy mws-config-hpc.groovy to the MWS home etc/ sub-directory, and rename it to mws-config.groovy.
    2. cp mws-config-hpc.groovy /opt/mws/etc/mws-config.groovy

    3. Give the Tomcat user "read" access to the /opt/mws/etc/mws-config.groovy file.
    4. In the /opt/mws/etc/mws-config.groovy file, make the following changes:
      • Modify the moab.secretKey setting to match the MWM secure key you generated earlier (contained in /opt/moab/etc/.moab.key).
      • Change the default MWS password (auth.defaultUser.password) to a password of your choosing.
      • (Optional) Change the default MWS username (auth.defaultUser.username) to any value you like.
      • [root]# vi /opt/mws/etc/mws-config.groovy

         

        ...

        moab.secretKey = "<ENTER-KEY-HERE>"

        moab.server = "localhost"

        moab.port = 42559

         

        // Change these to be whatever you like.

        auth.defaultUser.username = "admin"

        auth.defaultUser.password = "adminpw"

        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.

  15. Set the following parameters in your Tomcat CATALINA_OPTS:
  16. CATALINA_OPTS="-Xms256m -Xmx3g -XX:MaxPermSize=384m -DMWS_HOME=/opt/mws"

    Where you choose to store CATALINA_OPTS depends on various factors, including operating system and sysadmin preference. Here are some suggestions:

  17. Start Tomcat, and deploy mws.war. For example:
  18. chkconfig tomcat6 on

    service tomcat6 start

    cp /tmp/mws-install/mws-7.1.0/mws.war /var/lib/tomcat6/webapps

  19. Navigate to http://localhost:8080/mws/ in a web browser to verify that MWS is running (you will see some sample queries and a few other actions).
  20. Log in to MWS to verify that your credentials are working. (Your login credentials are the auth.defaultUser.username and auth.defaultUser.password values you set in the /opt/mws/etc/mws-config.groovy file.)
  21. Click to enlarge

    If you encounter problems, or if the application does not seem to be running, see the steps in the "Troubleshooting Installation "section of the Moab Web Services Reference Guide.

Related topics