Can I configure MATLAB to utilize multiple licenses from multiple license servers?

32 views (last 30 days)
Is it possible to allow a client machine to connect to a second MATLAB server if the first server does not have any MATLAB keys available?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 5 Oct 2023
Edited: MathWorks Support Team on 5 Oct 2023
While this configuration is possible, you will not be able to configure MATLAB to pull toolboxes from two license servers at the same time. Setting this configuration will only allow MATLAB to fail over to a second server if the first server is down or there are no MATLAB license keys available. Once MATLAB has connected to a network license manager, it remains locked to that license manager until the session has ended.
To enable this configuration, there are three options:
Option 1
- Create an environment variable, MLM_LICENSE_FILE, and set it to the port@host of the server machines in order. Doing this will vary based on your Operating System. For example:
Variable Name
MLM_LICENSE_FILE
Variable Value
port@hostname1;port@hostname2
  *NOTE* - A colon should be used rather than a semicolon on Linux and macOS machines.
Option 2
- Creating a network.lic and a network2.lic file. Open a text editor and it should read something similar to the example below. Be sure to save one file as a .lic file. "network.lic" and the other as "network2.lic".
network.lic
SERVER Server1 3C7C3FEEFC18 27000
USE_SERVER
network2.lic
SERVER Server2 2K8J5LMFEC90 27000
USE_SERVER
Place the files in your "<MATLABROOT>/licenses" folder.
Option 3
- Create another desktop shortcut for MATLAB and add a flag on startup. For Windows, this is done by right clicking the shortcut, selecting properties, and adding in the "Target" line a -c port@hostname. It should look similar to the example below, where the path is the path to your root MATLAB installation directory. Be sure to do this for both shortcuts for the licenses you wish to use. This option will eliminate any startup delay.
C:\...\R20XXx\bin\matlab.exe -c port@hostname1
C:\...\R20XXx\bin\matlab.exe -c port@hostname2
For MATLAB Parallel Server, worker licenses can be split up between two license server systems since each worker license is a separate MATLAB Parallel Server session.
NOTE: Starting in R2019a the following name changes occurred:
  • MATLAB Distributed Computing Server was renamed to MATLAB Parallel Server 
  • mdce_def was renamed to mjs_def
  • mdce binary was renamed to mjs

More Answers (0)

Categories

Find more on Manage Products 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!