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

28 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 22 Nov 2022
Edited: MathWorks Support Team on 22 Nov 2022
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 Non-Windows (Unix) systems.
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 and selecting properties and adding in the "Target" line a -c port@hostname it should look similar to the one below. be sure to do this for both shortcuts for the license you wish to use. Note the beginning is your MATLAB directory to the matlab.exe. This option will eliminate any startup delay.
C:\...\matlab.exe -c port@hostname1
C:\...\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
  3 Comments
Scott
Scott on 21 Jul 2015
Hi nlfits,
At the moment it is not possible to specify the license server location in port@host format in either the graphical or silent installer. A license file is required even if you have no intention of using a license file with MATLAB. I apologize for any inconvenience this may cause.
We are investigating the possibility of enhancing the installer to accept license information in port@host format.
Thanks,
-Scott
MathWorks Installation & Licensing Support

Sign in to comment.

More Answers (0)

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!