Skip to Main Content Skip to Search
Accelerating the pace of engineering and science

 

Product Support

1309 - Redundant Servers Guide



Introduction

  1. What is a redundant server?
  2. How should I select my redundant servers?
  3. Generating the License File
  4. Understanding the License File

Installing and Configuring Your Redundant License Servers

  1. How do I install the FLEXnet License Manager with a redundant server configuration?
  2. How do I start the FLEXnet License Manager daemons with a redundant server configuration?

Installing and Configuring Your MATLAB Client

  1. MATLAB Client Setup
      Conclusion: Redundant Servers and Related Issues


Introduction

Section 1: What is a redundant server?

When a large number of licenses are governed by a single license server, any failure of the server becomes a major event. To prevent problems, it may be desirable to set up redundant servers so that if one server goes down, the license manager can still function.

In the redundant server configuration, three machines are designated to be license servers. All three machines must be running at the time the license managers are started.  However, only two of the servers must remain operational; this is called a quorum. When a quorum exists, licenses will remain available to be checked out by clients.

Section 2: How should I select my redundant servers?

The first step in configuring the license manager is choosing the servers. The servers should be chosen with these three criteria in mind:
  1. These 3 machines should have VERY reliable connectivity with each other.
  2. When selecting servers, a primary (master) server needs to be chosen. This is the machine to which clients connect first, so it gets the majority of the network traffic. The primary server is the first server listed in the license file.
  3. The servers should be running supported versions of their operating systems.  For more information about compatibility, please see this page.
Once you have chosen the servers, you need to determine the Host ID of each server. You must submit all three servers' Host IDs in order for the license file to be properly generated. The easiest method of finding the Host ID is to use the lmhostid utility, which is installed with FLEXnet. If you do not already have this utility, you can use the following commands:

Windows: ipconfig /all
Solaris: hostid
Linux: ifconfig eth0
Mac: ifconfig en0

The Host ID is either the MAC address (sometimes listed as a physical address or as “hwaddr”) or the IP address of the machine’s primary Ethernet adapter (on Windows, it’s the first one listed; on Mac it is called en0, and on Linux/Unix it is called eth0).

Section 3: Generating the License File

The Administrator and/or Asset Manager contact(s) on your license are eligible to generate network license files.  If you are using R2007b or earlier, you will need to send your three Host IDs to The MathWorks Customer Service team in order for the license file to be generated.  You may submit these using the Contact Us page. If you are using R2008a or newer, please follow these steps to generate this file in the MathWorks.com License Center:
  1. Open http://www.mathworks.com/licensecenter using a supported web browser. You will be asked to log in. Please note that in order to generate the license file you will need to log in with the MathWorks.com credentials of the license’s Administrator or Asset Manager.
  2. Choose your network-based license from the table that appears in the License Center. Once you’ve done so, you will see the License Details appear below the table.
  3. Open the Activation and Installation tab. If there is currently an activation on the license, you will need to click the Deactivate button in order to remove it from your activations and clear the way for your new redundant server activation.
  4. Click the Activate button to begin activation. Choose “I have the Host ID” and click Continue. On the next screen, click the Advanced Options button to expand the secondary and tertiary Host ID fields. Fill out the form, entering the operating system of the license server, the primary, secondary, and tertiary Host IDs, and (if desired) an activation label. Click Continue to finalize your activation.
  5. On the following screen, you are given the choice of either downloading your license file and File Installation Key or having them emailed to you. We recommend that you download the license file here to avoid any formatting issues that email can sometimes introduce into the file.

Section 4: Understanding the License File

Once you have retrieved your license.dat file, a quick inspection will reveal that it is not easy to decipher. Let’s take a look first at the way your license file will look immediately after you retrieve it, and then we’ll take note of some important changes that happen during installation. In the following redundant server configuration, three Host IDs have been submitted to generate the following file. This version of the file, fresh from the MathWorks, is known as the “unprocessed” license file.

# MATLAB license passcode file.
# LicenseNo: 123456 Host ID: 0018F5A4D788
# Host ID: 0018F5A5E899
# Host ID: 0018F5A6F900
INCREMENT MATLAB MLM 21 01-feb-2025 10 C8CE6D30C5C2 \
VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
ISSUED=17-Apr-2009 BORROW=720 SN=518849
INCREMENT SIMULINK MLM 21 01-feb-2025 1 2BD6CB61F186 \
VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
ISSUED=17-Apr-2009 BORROW=720 SN=518849
Note that the license file is locked to all three Host IDs.

After you install FLEXnet (see Section 5 of this document for installation instructions), a “processed” license.dat file will be created in $MATLAB/etc (where $MATLAB is the root MATLAB directory)($MATLAB\flexlm for releases prior to R2010b on Windows). This processed license.dat file differs from the “unprocessed” file in that it will contain a SERVER line indicating the name of the host machine, and a DAEMON line with the specific path to your MLM binary.

During the installation procedure described within Section 5, you’ll install the FLEXnet software three times (once on each server, using the “unprocessed” license file each time). Then, you’ll combine the three SERVER lines generated during your three installations into one master license file. If your servers’ hostnames were pooh, piglet, and rabbit, this resulting file would look a lot like this:
SERVER pooh 0018F5A4D788 27000 
SERVER piglet 0018F5A5E899 27000
SERVER rabbit 0018F5A6F900 27000
DAEMON MLM /usr/local/matlab/etc/MLM
# MATLAB license passcode file.
# LicenseNo: 123456   Host ID: 0018F5A4D788
#                    Host ID: 0018F5A5E899
#                    Host ID: 0018F5A6F900
INCREMENT MATLAB MLM 21 01-feb-2025 10 C8CE6D30C5C2 \
    VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
    HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
    ISSUED=17-Apr-2009 BORROW=720 SN=518849
INCREMENT SIMULINK MLM 21 01-feb-2025 1 2BD6CB61F186 \
    VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
    HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
    ISSUED=17-Apr-2009 BORROW=720 SN=518849
Note that the finished “processed” license file must have three SERVER lines, one for each Host ID with which the license file was created. However, there is only one DAEMON line. This is because you must install FLEXnet in the same location on all three servers. So, the path on the DAEMON line is correct for all three servers.

For instructions on how to use your unprocessed license file to install your three servers, please continue to Section 5.

Installing and Configuring Your Redundant License Servers

Section 5: How do I install the FLEXnet License Manager with a redundant server configuration?

Installing your FLEXnet License Managers in a redundant server configuration is very similar to a single-server installation – in fact, the main difference is that it is repeated three times.  Please follow the instructions below to complete your installations.  Before installing, make sure you’ve generated your 3-server license file (as described in Section 3) and that you have the File Installation Key (R2008a and newer) or Personal License Passcode (Windows, pre-R2008a) where required.

Part 1: Preparation


For a redundant server configuration, the FLEXnet server software must reside on the same path on all three server machines.  This means a) that all three servers must be members of the same operating system families (Unix/Linux, Mac, or Windows) and b) that when you carry out your three installations, you choose the same path each time. 

For most Windows users, the default installation path (C:\Program Files\MATLAB\<release number>)  will work fine, but if your three machines have different primary drive letters, you will need to find or create an installation path that exists on all three machines.  Be sure to remember what this path is so that you can specify it during each installation.

For Mac users, the default installation path varies somewhat by release, but will usually be your /Applications/MATLAB_<release number> folder.  Please keep in mind that as of R2008b, MATLAB on the Mac exists as a .app file which you can expand into a folder by right-clicking (or ctrl-clicking) on it and choosing “Show Package Contents”.

Most Unix and Linux users install into /usr/local/matlab, but this may not be the default path shown by the installer.  In any case, it is best to decide on a path before you start installation so you can be sure to apply it to all three installations.

Part 2: Installation


For R2008a and newer (all platforms):

  1. On your primary license server machine, start the installer. For Windows, this will mean double-clicking on Installer.exe or setup.exe. For Mac, you’ll need to launch InstallForMacOSX.app. On Linux and Unix, you’ll need to run install.
  2. On the first screen, select “Install manually without the Internet” and click Next.
  3. After agreeing to the license agreement, select “I have my File Installation Key” and enter the File Installation Key you obtained in Section 3. Click Next.
  4. Click Browse and locate your “unprocessed” license.dat file, obtained in Section 3.
  5. When prompted, select a “Custom” rather than “Typical” installation. Click Next.
  6. Enter your installation path. If you do not use the default path, make a note of this path so that you can be sure to enter the same path on the other servers. Click Next.
  7. On the following screen, make sure that the box that appears next to the License Manager is checked. It is best to uncheck all other products at this stage – until you’re done configuring your triad you’re not ready to install your MATLAB Clients (see Section 7 for MATLAB Client installation). Click Next.
  8. Proceed with installation until it’s complete, making sure to choose to have the license manager service automatically configured if given the option.
  9. Repeat steps 1-8 on your secondary license server, then repeat them once more on your tertiary license server.  Continue with Part 3 below to complete your triad configuration.

For R2007b and earlier:

Windows

  1. Start the installer on your primary license server by running Installer.exe or Setup.exe. Choose "Install" and click Next.
  2. Enter your Personal License Passcode (PLP) and click Next.
  3. When prompted to enter the path to your license.dat file, browse to the location of the “unprocessed” license.dat file you created from the passcode email you received.
  4. Continue through the installation. When prompted to choose an Installation Type, select "Custom" and click Next.
  5. Select your installation path. If you do not use the default path, make a note of this path so that you can be sure to enter the same path on the other servers.
  6. When prompted to select products to install, check the box for "License Manager" and click Next. It is best to uncheck all other products at this stage – until you’re done configuring your triad you’re not ready to install your MATLAB Clients (see Section 7 for MATLAB Client installation).
  7. Proceed with the installation until it is completed, opting to configure the license manager service automatically if prompted.
  8. Repeat steps 1-6 on your secondary license server. Then, repeat them on your tertiary server. Continue with Part 3 below to complete your triad configuration.

Linux/Unix

  1. Create a directory where the license manager will be installed into. Make sure this path is available and empty on all three of your license server machines.  Make a note of it so that you can be certain to use exactly the same installation path on your secondary and tertiary server installations. Example: /usr/local/MATLAB/
  2. Into this folder place a copy of the “unprocessed” license.dat file you created from the passcode email you received.
  3. Browse to the MATLAB directory that you created in step 1. From this location, run the installer using the full path to the installer location. Example: /cdrom/install
  4. Click OK to start installation. After consenting to the license agreement, confirm your installation path. If you do not use the default path, make a note of this path so that you can be sure to enter the same path on the other servers.
  5. Confirm your license file and continue through the installation. When prompted to select products to install, check the box for "License Manager" and click Next. It is best to uncheck all other products at this stage – until you’re done configuring your triad you’re not ready to install your MATLAB Clients (see Section 7 for MATLAB Client installation).
  6. Repeat steps 1-5 on your secondary license server. Then, repeat them on your tertiary license server. Continue with Part 3 below to complete your triad configuration.

Mac

  1. Place upon your Desktop a copy of the “unprocessed” license.dat file you created from the passcode email you received.
  2. Start the installation using the InstallForMacOSX application.
  3. If prompted for password, enter your Mac system password.
  4. After consenting to the license agreement, select your installation path. If you do not use the default path, make a note of this path so that you can be sure to enter the same path on the other servers.
  5. When prompted for your license file information, drag the license.dat file from your desktop into this window.
  6. Proceed through the installation. When prompted to select products to install, check the box for "License Manager" and click Next. It is best to uncheck all other products at this stage – until you’re done configuring your triad you’re not ready to install your MATLAB Clients (see Section 7 for MATLAB Client installation).
  7. Repeat steps 1-5 on your secondary license server. Then, repeat them on your tertiary license server.  Continue with Part 3 below to complete your triad configuration.

Part 3: Additional Configuration


After you have completed the FLEXnet installation on all three servers, you will need to compile your final processed license file by adding the individual SERVER lines generated during each installation into one master license.dat file. Please follow the steps below to finalize your server configuration:
  1. On each server machine, locate the “processed” license.dat file, which can be found inside the $MATLAB/etc (where $MATLAB is the root MATLAB directory)($MATLAB\flexlm for releases prior to R2010b on Windows).
  2. Note that each file is identical save for the SERVER line, which should be the first line in each file. The final license.dat file will have 3 server lines, one from each of these three files.
  3. Copy the secondary license server and tertiary license servers’ license.dat files onto the primary license server.  You’ll need to rename them or put them into different folders.
  4. With all three files open in a plain text editor, copy and paste the SERVER lines from the second and third processed license.dat files into the primary server’s license.dat file. These lines must be in order; the first line of the file should be the primary server’s SERVER line, the second line should be the secondary server’s SERVER line, and the third line should be the tertiary server’s SERVER line. (The fourth line will be the DAEMON line which is true for all 3 machines).
Your new license.dat file should look something like this:
SERVER pooh 0018F5A4D788 27000 
SERVER piglet 0018F5A5E899 27000
SERVER rabbit 0018F5A6F900 27000
DAEMON MLM /usr/local/matlab/etc/MLM
# MATLAB license passcode file.
# LicenseNo: 123456   Host ID: 0018F5A4D788
#                    Host ID: 0018F5A5E899
#                    Host ID: 0018F5A6F900
INCREMENT MATLAB MLM 21 01-feb-2025 10 C8CE6D30C5C2 \
    VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
    HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
    ISSUED=17-Apr-2009 BORROW=720 SN=518849
INCREMENT SIMULINK MLM 21 01-feb-2025 1 2BD6CB61F186 \
    VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
    HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
    ISSUED=17-Apr-2009 BORROW=720 SN=518849
Finally, copy this combined “processed” license.dat file to each server machine, replacing the existing license.dat files from which you took the three SERVER lines.  Again, these files should go in the $MATLAB/etc (where $MATLAB is the root MATLAB directory)( for releases prior to R2010b on Windows)

You’ll want to keep a copy of this file handy, as it will also be used during the installation of your MATLAB clients.

Section 6: How do I start the FLEXnet License Manager daemons with a redundant server configuration?

Starting FLEXnet On Unix, Linux or Mac: To bring up the three license managers interactively, login to each machine as a non-privileged user and run the lmstart script. For example, if the MATLAB root directory is /usr/local/matlab, use the following procedure:
  1. Login to the primary (master) server, the first server listed in your license.dat file , as a non-privileged user, then type the following:
    cd $MATLAB/etc
    lmstart
    (where $MATLAB is your root MATLAB directory)
  2. Login to the second server listed in your license.dat file as a non-privileged user, then type the above commands.
  3. Login to the third server listed in your license.dat file as a non-privileged user, then type the above commands.
Starting FLEXnet On Windows: To bring up the three license managers, use the lmtools.exe utility located in the $MATLAB\etc\win32|win64 (where $MATLAB is the root MATLAB directory)($MATLAB\flexlm for releases prior to R2010b) folder on each server. Follow these steps on each machine, one after the other:
  1. In LMTOOLS on the primary server, first look at the Service/License File tab. Make sure that “Configuration using Services” is checked and that the MATLAB License Manager service is highlighted. Also, please make sure the LMTOOLS Ignores License File Path Environment Variables checkbox is checked.
  2. Go to the Start/Stop/Reread tab. Click “Start Server”.
  3. Repeat steps 1 and 2 on the secondary server.
  4. Repeat steps 1 and 2 on the tertiary server.
Wait for the license manager daemons on the three machines to synchronize with each other. This may take a few minutes. After about 5 minutes, query the license server status:

Confirming your FLEXnet Status On Unix, Linux or Mac:

To query the license server status, run the following command from within the $MATLAB/etc folder:
./lmstat –a
Confirming your FLEXnet Status On Windows:

To query the license server status, go to LMTOOLS’ “Server Status” tab and click “Perform Status Enquiry”.

These commands perform the same queries regardless of platform and should report that the license server is up, along with some other details.  To make sure the license manager is running correctly on all nodes, you may repeat the above status checks on your secondary and tertiary nodes.

If, for some reason, the license manager daemons do not connect, take the daemons down on each machine (Unix/Mac: $MATLAB/etc/lmdown; Windows: “Stop Server” on the Start/Stop/Reread tab in LMTOOLS), and run the procedure over again. Network traffic may affect the synchronization, so it may require several attempts before a proper connection is established.

Again, all three machines must connect for the license manager to begin serving keys. Once the daemons are up and connected on all three machines, only two machines are needed for a quorum; the loss of any one server will not cause any licenses to be revoked. However, the loss of any two servers will cause the license manager to shut down.

Installing and Configuring Your MATLAB Client

Section 7: MATLAB Client Setup

Installation of the clients proceeds in the same way as any other MATLAB network client installation, followed by an additional step.  Please note that the license.dat file you should use during client configuration is the master “processed” file you built in Section 5, Part 3, containing all three SERVER lines.  Unless you’re installing MATLAB R2007b or earlier on a Unix/Linux or Mac platform, you’ll also need the File Installation Key or PLP from Section 5.

Part 1: Installation

R2008a and higher (all platforms):

  1. Start the installer. For Windows, this will mean double-clicking on Installer.exe or setup.exe. For Mac, you’ll need to launch InstallForMacOSX.app. On Linux and Unix, you’ll need to run install.
  2. On the first screen, select “Install manually without the Internet” and click Next.
  3. After agreeing to the license agreement, select “I have my File Installation Key” and enter the File Installation Key you obtained in Section
  4. Click Next.
  5. Choose a Typical installation and click Next. (You can choose Custom if you'd like to install a subset of the available products.)
  6. Confirm the installation folder and click Next.
  7. If you chose a “Custom” installation, choose your products to install and click Next.
  8. Enter the path or browse to the “processed” license.dat file you created in Part 3 of Section 5 and click Next.
  9. Review the list of products to be installed and confirm your installation settings by clicking Install.
  10. Complete any further configuration steps (depending on your products). When installation is complete, click Finish to launch MATLAB.

R2007b and below:

Windows

  1. Start the installer by double-clicking on Installer.exe or setup.exe.
  2. Enter the Personal License Passcode (PLP) when prompted.
  3. When prompted to enter the path to your license.dat file, browse to the location of the “processed” license.dat file created in Part 3 of Section 5.
  4. Click Next and continue through the installation.  Click Finish to launch MATLAB.

Linux/Unix

  1. Create a MATLAB directory where MATLAB will be installed into. Example: /usr/local/MATLAB/
  2. Place a copy of the processed license.dat file from Part 3 of Section 5 into this MATLAB directory.
  3. Browse to the MATLAB directory that you created in step 1. From this location, run the installer using the full path to the installer location.  Example: /cdrom/install
  4. Click Next and continue through the installation until it concludes. Click Finish to start MATLAB.

Mac

  1. Place upon your Desktop the license.dat created in Part 3 of Section 5.
  2. Start the installation using the InstallForMacOSX application.
  3. If prompted for password, enter your Mac system password.
  4. Continue the installation until you reach the point where you are prompted for your license file information. Drag the license.dat file from your desktop into the installer window.
  5. Continue the installation from this point until it concludes, then click Finish to launch MATLAB. You can remove the license.dat from the Desktop once the installation is complete.

Part 2: Final Client Configuration


After installation is complete, the client license.dat file should be removed and an environment variable should be used in its place. On Windows the client license.dat file is located in $MATLAB\bin\win32 (for R2007b and earlier) or $MATLAB\licenses (R2008a and newer). On UNIX/Linux/Mac this license.dat file is placed in $MATLAB/etc (for R2007b and earlier) and $MATLAB/licenses (R2008a and newer). The environment variable that should be added is as follows, on all platforms:
MLM_LICENSE_FILE=port@server1,port@server2,port@server3
Here, "port" refers to the number at the end of the SERVER line in the license file (27000 is the default) while "server" refers to the hostname of your server as defined in the SERVER line of the license file.

This step allows client redundancy so that if a server fails while a client license is checked out the client will search to the next server instead of posting an error. This also will remove the need to update the client license files if the server license files are changed.

For more on how to set these environment variables, please refer to your operating system’s documentation.

Conclusion: Redundant Servers and Related Issues

Congratulations!  You’ve configured your new redundant server array.  If one of your three servers goes down, your MathWorks products will still be available. 

If you have trouble with your redundant servers, please see the following solutions for some common issues and suggested workarounds:

“Is it possible to use greater or fewer than 3 servers in a redundant server configuration?”

“R2008a returns “License Manager Error -5” when using toolboxes in a redundant server array.” (Bug report; Login required)

“Why do I receive an error about redundant server communication when starting the license manager using the lmstart command?”

“How do I delay the heartbeat between the Primary and backup Servers in a redundant setup?”

“Why am I getting a license manager error -8 when running redundant servers?”