What are redundant servers, how do I generate a license file for one, and how do I set it up?

67 views (last 30 days)
I would like to know what redundant servers are, and how to generate and install a redundant server license file for MATLAB and associated products.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 12 Jan 2024
Edited: MathWorks Support Team on 12 Jan 2024

Table of Contents

 

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 Network 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 Network 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 Network 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 the Network License Manager. If you do not already have this utility, you can use the following commands, depending on your Operating System:
  • Windows: ipconfig /all
  • Linux/macOS: ifconfig
  • Mac: ifconfig
The Host ID is either the MAC address or the IP address of the device connecting the computer to the local area network. If an IP address is used, it is highly recommended to use a static IP address. Otherwise, the IP address will change, making the license file unusable until the computer is assigned to the IP address in the license file again.

Section 3: Generating the License File

The License Administrator(s) on your license are eligible to generate network license files with the steps below:
  1. Open the License Center using a 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(s).
  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 a License Server" button to begin activation. 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.lic 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 07-apr-2030 10 C8CE6D30C5C2 \
VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
ISSUED=07-Apr-2023 BORROW=720 SN=518849
INCREMENT SIMULINK MLM 21 07-apr-2030 1 2BD6CB61F186 \
VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
ISSUED=07-Apr-2023 BORROW=720 SN=518849
Note that the license file is locked to all three Host IDs.
After you install the Network License Manager (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). 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 Network License Manager 3 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 07-apr-2030 10 C8CE6D30C5C2 \
VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
ISSUED=07-Apr-2023 BORROW=720 SN=518849
INCREMENT SIMULINK MLM 07-apr-2030 1 2BD6CB61F186 \
VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
ISSUED=07-Apr-2023 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 the Network License Manager 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.

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

Installing your Network License Manager 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). Once you've done that, you may skip to Step 2 in the instructions linked below.
Install License Manager on License Server
After you have completed the Network License Manager installation on all 3 servers, you will need to finalize your 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)
  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 07-apr-2030 10 C8CE6D30C5C2 \
VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
ISSUED=07-Apr-2023 BORROW=720 SN=518849
INCREMENT SIMULINK MLM 21 07-apr-2030 1 2BD6CB61F186 \
VENDOR_STRING=vi=0:at=200:lo=CN:lu=300:ei=966432: \
HOSTID=ID=518849 DUP_GROUP=UH asset_info=518849 \
ISSUED=07-Apr-2023 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)
You’ll want to keep a copy of this file in an accessible location, as it will also be used during the installation of your MATLAB clients.

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

Follow the instructions from the link below. Repeat the process for all 3 Network License Managers.
How do I start or stop the Network License Manager?

Section 7: MATLAB Client Setup

Installation of MATLAB for clients/End Users can be performed by following the steps from the link below:
Install Products on Client Machines
After installation is complete, the client's network.lic file should be removed and an environment variable should be used in its place. On Windows, the client network.lic file is located in $MATLAB\licenses. On Linux/Mac this network.lic file is placed in $MATLAB/licenses. 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. Make sure you separate each server with a comma (,)
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.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

No tags entered yet.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!