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

2concurrentlicensesMATLABmultipleservers

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?

Best Answer

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, follow the instructions below:
1) Create an environment variable, MLM_LICENSE_FILE, and set it to the port@host of the server machines in order. For example:
MLM_LICENSE_FILE=port@hostname1;port@hostname2
Alternatively, you can Edit the MATLAB shortcut icon so the target path reads:
C:\...\matlab.exe -c port@hostname1;port@hostname2
NOTE: If you are running an R13 client or below, you will not be able to run the license manager in the port range 27000-27009. To allow this failover, you will need to set the port number for the license manager to a range such as 1700-1711.
Also, a colon should be used rather than a semicolon on Non-Windows (Unix) systems.
For MATLAB Parallel Server, worker licenses can be split up between two license server systems since each worker license is a seperate 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