LIGHTWEIGHT GRID MANAGER TUTORIAL

Service Operation

The Wolfram Lightweight Grid Manager runs as a server on each machine that you wish to provide services for the grid. This section describes issues relating to how the server runs on each platform.

If you want to check the server, the web interface is probably more convenient. This section is useful if you want to see details about how the server is launched as a service by the operating system.

Windows

The Lightweight Grid is installed as a service under the Windows operating system. You can review the service by looking at the Services control, which is launched from the Control Panel by choosing Administrative Tools and then Services. The Lightweight Grid appears in the service list. Here you can restart or stop the service. Right-click on the service name and select Properties to open the dialog window shown below.

1.gif

Here you can change various parameters for the service, such as whether it is launched automatically when the machine is started or what user should run the service.

When you stop or restart the service, sometimes Windows is slow to get final notification that it has stopped and puts up a warning dialog, but the service has in fact stopped.

If you want to check that the service is running, you can use the Windows Task Manager, which should show that the server is running.

2.gif

Linux

The Lightweight Grid runs as a background process or daemon under Linux. Typically, this is set up by a script for starting and stopping the server located in the directory /etc/init.d. The script is invoked at boot time by files in the runlevel directories, such as /etc/rc3.d, /etc/rc4.d, and /etc/rc5.d. The actual meaning of the runlevel directories differs between systems. On many Linux distributions runlevel 3 is used for multi-user startup and 5 for multi-user startup with an X interface.

Once the Lightweight Grid has been set up you can manually shut it down or start it up by executing the file /etc/init.d/wolframlightweightgrid, typically as root. A sample session that starts the server is shown below.

linux> sudo /etc/init.d/wolframlightweightgrid start
Starting tomcat: Starting Tomcat
Using CATALINA_BASE: /usr/local/Wolfram/gridMathematicaServer/9.0/SystemFiles/RemoteServices/tomcat
Using CATALINA_HOME: /usr/local/Wolfram/gridMathematicaServer/9.0/SystemFiles/RemoteServices/tomcat
Using CATALINA_TMPDIR: /usr/local/Wolfram/gridMathematicaServer/9.0/SystemFiles/RemoteServices/tomcat/temp
Using JAVA_HOME: /usr/local/Wolfram/gridMathematicaServer/9.0/SystemFiles/Java/Linux-x86-64
Tomcat running as PID 12062.
linux>

In typical operation the daemon is started automatically at boot time, but for administrative reasons the daemon can be controlled directly with these commands:

sudo /etc/init.d/wolframlightweightgrid start
sudo /etc/init.d/wolframlightweightgrid stop
sudo /etc/init.d/wolframlightweightgrid restart

Here are the runlevel scripts in the rc3.d directory.

linux> ls -l /etc/rc3.d/S99wolframlightweightgrid
lrwxrwxrwx 1 root root 16 Dec 25 18:03 /etc/rc3.d/S99wolframlightweightgrid -> ../init.d/wolframlightweightgrid*
linux> ls -l /etc/rc3.d/S99wolframlightweightgrid
lrwxrwxrwx 1 root root 16 Dec 25 18:03 /etc/rc3.d/K99wolframlightweightgrid -> ../init.d/wolframlightweightgrid*
linux>

If you do not set up the Lightweight Grid with the installer, as described in the section "Installation: Linux", you can set it up later. You will need to have run the installer to get the gridMathematica Server layout. Using the chown -R command, change the file ownership for the layout to the user running the web server. From the layout, copy the file SystemFiles/RemoteServices/SystemFiles/Unix/wolframlightweightgrid to /etc/init.d. Then edit it to set three variables: GRIDM_HOME, the path to the gridMathematica Server layout; WEBUSER, the user running the web server; WEBUSER_HOME, the path to the WEBUSER home directory; and SYSTEM_ID, the value of $SystemID used by Mathematica on the computer.

Here is an example portion of the wolframlightweightgrid file after it has been customized.

GRIDM_HOME=/opt/Wolfram/gridMathematicaServer/9.0
export GRIDM_HOME
INSTALLROOT=$GRIDM_HOME
export INSTALLROOT
WEBUSER=griduser
export WEBUSER
WEBUSER_HOME=/home/griduser
SYSTEM_ID=Linux-x86-64
export SYSTEM_ID

After customizing /etc/init.d/wolframlightweightgrid, make symlinks from the runlevel directories to /etc/init.d. Finally, you should set the web administrator password to allow web changes to configuration. You can then start the server and your Lightweight Grid should be operating.

If you want to deactivate the Lightweight Grid, stop the server, remove /etc/init.d/wolframlightweightgrid, and remove any runlevel entries.

Mac OS X

The Lightweight Grid on Mac OS X runs as a Startup Item named WolframLightweightGridManager located in /Library/StartupItems. This contains two files, StartupParameters.plist and WolframLightweightGridManager. A default copy of these files is also found in the application layout in SystemFiles/RemoteServices/SystemFiles/MacOSX.

Once the Lightweight Grid has been set up, you can manually shut it down or start it up by executing the program /sbin/SystemStarter, typically as root. This is demonstrated in the following.

sudo /sbin/SystemStarter start "Wolfram Lightweight Grid"
sudo /sbin/SystemStarter stop "Wolfram Lightweight Grid"
sudo /sbin/SystemStarter restart "Wolfram Lightweight Grid"

If you do not set up the Lightweight Grid with the installer, as described in the section "Installation: Mac OS X", you can set it up later. To do this you should create or identify a user account to run the server. Using the chown -R command, change the file ownership for the layout to the user running the web server. Then from gridMathematicaServer.app copy SystemFiles/RemoteServices/SystemFiles/MacOSX/WolframLightweightGridManager to /Library/StartupItems. You should also ensure the setting for APP_ROOT, the application root, and WEBUSER, the user running the server in WolframLightweightGridManager, are correct. Finally, you should set the web administrator password to allow web changes to configuration. You can then start the server and your Lightweight Grid should be operating.

If you want to deactivate the Lightweight Grid, stop the server and remove the entry in /Library/StartupItems.

New to Mathematica? Find your learning path »
Have a question? Ask support »