Clear Filters
Clear Filters

Matlab 2021 command line activation

25 views (last 30 days)
We installed Matlab 2021a on 300 machines and activate it with license server. Now we need to change the license server from L1 to L2 as L1 does not exist any more. Is there any method or command line to push to all those 300 machines that points to new license server instead of the old one. Appreciate your response.

Answers (1)

Himanshu
Himanshu on 15 Dec 2023
Hey Nazar,
I understand that you are trying to change the license server for all your machines as your current license server does not exist anymore.
I am not sure if the following will help you change the license server for all machines at once, but changing the license server for individual machines can be accomplished in 3 ways. You may try these out to see if these are helpful.
1) Replacing the license files MATLAB uses.
2) Setting an environment variable to point to a new server.
3) Launching MATLAB using the -c flag.
Method 1
MATLAB clients will have a license file located in $MATLAB\licenses (R2008a or later) or $MATLAB\bin\win32 (windows) or $MATLAB/etc (Linux/Mac). This file consists of a SERVER line, and a USE_SERVER line. To retarget the client, replace the SERVER line with the new SERVER line from the new manager, save the file, and start MATLAB.
Method 2
During MATLAB's startup, it checks the environment variables "LM_LICENSE_FILE" and "MLM_LICENSE_FILE". To launch MATLAB using a license from a new server, set an environment variable with either of these names to a value using the syntax {port}@{hostname} of the license server, where {port} is the number at the end of the SERVER line, and {hostname} is the resolvable name of the license manager.
For example, if the Network License Manager had a server line that read as follows:
SERVER licenseserver1 001122aabbcc 27000
the environment variable value should be set as
LM_LICENSE_FILE=27000@licenseserver1
In the example above licenseserver1 is the hostname, 001122aabbcc is the Host ID (in this case, a physical/MAC address), and 27000 is the port number.
Method 3
When launching MATLAB, you can also force it to use a particular license by using the -c flag. The argument that follows -c can be in the form of a path to a license file or using the <port>@<hostname> syntax mentioned above. For example:
matlab -c 12345@licenseserver
On Windows machines, you can modify the target field of the MATLAB shortcut as follows for a similar effect:
"C:\Program Files\MATLAB\R2022b\bin\matlab.exe" -c 12345@licenseserver
Hope this helps!

Categories

Find more on Manage Products in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!