Main Content

Shut Down a Job Manager Cluster

If you are done using the job manager and its workers, you can shut down the server software processes so that they are not consuming network resources. You do not need to be at the computer running the processes that you are shutting down. You can run these commands from any machine with network access to the processes. The following sections explain shutting down the processes for different platforms.

Linux Operating Systems

Enter the commands of this section at the prompt in a shell.

Stopping the Job Manager and Workers

  1. To shut down the job manager, enter the commands:

    cd matlabroot/toolbox/parallel/bin
    

    (Enter the following command on a single line.)

    stopjobmanager -remotehost <job manager hostname> -name 
    <MyJobManager> -v
    

    If you have more than one job manager running, stop each of them individually by host and name.

    For a list of all options to the script, enter this command:

    stopjobmanager -help
    
  2. For each MATLAB® worker you want to shut down, enter these commands:

    cd matlabroot/toolbox/parallel/bin
    stopworker -remotehost <worker hostname> -v
    

    If you have more than one worker session running, you can stop each of them individually by host and name:

    stopworker -name worker1 -remotehost <worker hostname>
    stopworker -name worker2 -remotehost <worker hostname>
    

    For a list of all options to the script, type:

    stopworker -help

Stop and Uninstall the mjs Service

Stop mjs Service with systemd.  Normally, you use the systemd system and service manager to start the mjs service at boot time and continue running until the machine shuts down. However if you plan to uninstall the MATLAB Parallel Server™ product from a machine, you can also disable the mjs systemd service because you no longer need it.

Note

You must have root privileges to stop or disable the mjs systemd service.

  1. Use the following command to stop the mjs systemd service:

    systemctl stop mjs.service
    
  2. Disable the mjs systemd service to prevent the service from starting up again at system reboot:

    systemctl disable mjs.service
  3. Manually locate and delete the mjs systemd unit file along with any remaining target files and symbolic links related to it:

    find /etc/systemd/system | grep "mjs.service"
    find /usr/lib/systemd/system | grep "mjs.service"

  4. Reload and reset the systemd service files to update your changes:

    systemctl daemon-reload
    systemctl reset-failed
    

Stop mjs Service Without systemd.  If you did not configure systemd to start the mjs service at boot time, use these commands to stop the mjs service:

cd matlabroot/toolbox/parallel/bin
mjs stop

Microsoft Windows Operating Systems

Stop the Job Manager and Workers

Enter the commands of this section at the prompt in a Windows command prompt window.

  1. To shut down the job manager, enter the commands

    cd matlabroot\toolbox\parallel\bin
    

    (Enter the following command on a single line.)

    stopjobmanager -remotehost <job manager hostname> -name 
    <MyJobManager> -v
    

    If you have more than one job manager running, stop each of them individually by host and name.

    For a list of all options to the script, type

    stopjobmanager -help
  2. For each MATLAB worker you want to shut down, enter the commands

    cd matlabroot\toolbox\parallel\bin
    stopworker -remotehost <worker hostname> -name <worker name> -v
    

    If you have more than one worker session running, you can stop each of them individually by host and name.

    stopworker -remotehost <worker hostname> -name <worker1 name>
    stopworker -remotehost <worker hostname> -name <worker2 name>
    

    For a list of all options to the script, type

    stopworker -help

Stop and Uninstall the mjs Service

Normally, you configure the mjs service to start at system boot time and continue running until the machine shuts down. If you need to stop the mjs service while leaving the machine on, enter the following commands at a Windows command prompt:

cd matlabroot\toolbox\parallel\bin
mjs stop

If you plan to uninstall the MATLAB Parallel Server product from a machine, you might want to uninstall the mjs service because you no longer need it.

You do not need to stop the service before uninstalling it.

To uninstall the mjs service, enter the following commands at a Windows command prompt:

cd matlabroot\toolbox\parallel\bin
mjs uninstall