7 Floating license setup

A floating license is tied to a particular computer acting as a token server. A token server is a service on Windows and a daemon on UNIX that serves license tokens to MOSEK client programs over the LAN.

You may think of the token server as a computer with a bag of license tokens. Whenever a client computer starts using MOSEK, a license token is requested from the token server, and when MOSEK completes it sends back the license token to the token server. The following diagram Fig. 7.1 conveys the overall idea.

_images/token-server-diagram.svg

Fig. 7.1 General floating license scheme: any MOSEK instances that can connect to the token server can get a valid license.

This implies that you cannot use more license tokens than is available at any given point in time. Moreover, MOSEK can be used on any computer connected to the token server through the local area network. In particular MOSEK can also be used on the computer acting as token server.

A license file that contains at least one floating license always starts with

SERVER hostname hostid port

Observe that

  • installing a license file without a SERVER line with a token server is NOT needed and is NOT possible.

  • at most one token server can be running on any given machine.

The token server consists of two daemons

  • lmgrd: The token server daemon running as a service,

  • moseklm: A daemon started by lmgrd.

The following subsections guide through the setup of a token server on Windows, Linux and macOS.

7.1 Windows: Token server setup

Below is a step-by-step guide for installing a token server on Windows and setting it to run as a service.

Prerequisites and locating the files

  • Make sure you have administrative privileges.

  • Locate the bin folder of your MOSEK installation, that is

    <MSKHOME>\mosek\10.0\tools\platform\<PLATFORM>\bin\

    where <PLATFORM> is the platform you are working on. That folder contains the files lmgrd.exe and MOSEKLM.exe required by the license system.

    _images/flexlm-files.png
  • Download the license file and store it on the local drive.

    Warning

    To avoid issues with service permissions, it is recommended to keep the license file in the same bin folder as above. Alternatively, you can keep all the license-related files in a separate folder; in this case it must contain the license file and the files lmgrd.exe and MOSEKLM.exe from the bin folder above.

Installation of the service

  • Locate and start the program lmtools. You can find it in the same bin folder as above and also in the MOSEK Start Menu if MOSEK was installed with the MSI installer.

    _images/flexlm-menu.png
  • In the Service/License file TAB select Configuration using Services.

    _images/flexlm-selectservice.png
  • Go to the Config Services TAB.

    _images/flexlm-configure.png
    • In Service name input your chosen name for the service.

    • In Path to the lmgrd.exe file navigate to the previously located lmgrd.exe file in the bin folder of the MOSEK installation (or another location if you moved it).

    • In Path to the license file navigate to the location of your MOSEK license file.

    • Tick the box Use Services and then tick the box Start server at Power Up.

    • Click Save Service and confirm that you want to save the service.

  • Go to the Start/Stop/Reread TAB.

    _images/flexlm-starttab.png
    • Choose your service from the list and click Start Server.

    • You should see the message Server start successful in the status line at the bottom.

      _images/flexlm-server-successful.png

Checking that startup succeeded

To get a quick overview of the server start go to the Config Services TAB and click View log. A log file from a successful start should look similarly to:

9:49:15 (lmgrd) -----------------------------------------------
9:49:15 (lmgrd)   Please Note:
9:49:15 (lmgrd) 
9:49:15 (lmgrd)   This log is intended for debug purposes only.

.....

9:49:15 (lmgrd) 
9:49:15 (lmgrd) -----------------------------------------------
9:49:15 (lmgrd) 
9:49:15 (lmgrd) 
9:49:15 (lmgrd) Server's System Date and Time: Mon Feb 28 2022 09:49:15 CET
9:49:15 (lmgrd) SLOG: Summary LOG statistics is enabled.
9:49:15 (lmgrd) FlexNet Licensing (v11.18.3.0 build 283040 x64_lsb) started on hostname (linux) (2/28/2022)
9:49:15 (lmgrd) Copyright (c) 1988-2021 Flexera. All Rights Reserved.
9:49:15 (lmgrd) World Wide Web:  http://www.flexerasoftware.com
9:49:15 (lmgrd) License file(s): /home/username/mosek/mosek-floating.lic
9:49:15 (lmgrd) lmgrd tcp-port 27007
9:49:15 (lmgrd) (@lmgrd-SLOG@) ===============================================
9:49:15 (lmgrd) (@lmgrd-SLOG@) === LMGRD ===
9:49:15 (lmgrd) (@lmgrd-SLOG@) Start-Date: Mon Feb 28 2022 09:49:15 CET
9:49:15 (lmgrd) (@lmgrd-SLOG@) PID: 2147425
9:49:15 (lmgrd) (@lmgrd-SLOG@) LMGRD Version: v11.18.3.0 build 283040 x64_lsb ( build 283040 (ipv6))
9:49:15 (lmgrd) (@lmgrd-SLOG@) 
9:49:15 (lmgrd) (@lmgrd-SLOG@) === Network Info ===
9:49:15 (lmgrd) (@lmgrd-SLOG@) Listening port: 27007
9:49:15 (lmgrd) (@lmgrd-SLOG@) 
9:49:15 (lmgrd) (@lmgrd-SLOG@) === Startup Info ===
9:49:15 (lmgrd) (@lmgrd-SLOG@) Server Configuration: Single Server
9:49:15 (lmgrd) (@lmgrd-SLOG@) Command-line options used at LS startup: -c /home/username/mosek/mosek-floating.lic 
9:49:15 (lmgrd) (@lmgrd-SLOG@) License file(s) used:  /home/username/mosek/mosek-floating.lic
9:49:15 (lmgrd) (@lmgrd-SLOG@) ===============================================
9:49:15 (lmgrd) Starting vendor daemons ... 
9:49:15 (lmgrd) Started MOSEKLM (internet tcp_port 36867 pid 2147427)
9:49:15 (MOSEKLM) FlexNet Licensing version v11.18.3.0 build 283040 x64_lsb
9:49:15 (MOSEKLM) SLOG: Summary LOG statistics is enabled.
9:49:15 (MOSEKLM) SLOG: FNPLS-INTERNAL-CKPT1
9:49:15 (MOSEKLM) SLOG: VM Status: 0
9:49:15 (MOSEKLM) SLOG: FNPLS-INTERNAL-CKPT5
9:49:15 (MOSEKLM) SLOG: TPM Status: 0
9:49:15 (MOSEKLM) SLOG: FNPLS-INTERNAL-CKPT6
9:49:15 (MOSEKLM) Server started on hostname for:	PTS		
9:49:15 (MOSEKLM) PTON		
9:49:15 (MOSEKLM) EXTERNAL FILTERS are OFF
9:49:15 (lmgrd) MOSEKLM using TCP-port 36867
9:49:15 (MOSEKLM) SLOG: Statistics Log Frequency is 240 minute(s).
9:49:15 (MOSEKLM) SLOG: TS update poll interval is 600 seconds.
9:49:15 (MOSEKLM) SLOG: Activation borrow reclaim percentage is 0.
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) ===============================================
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Vendor Daemon ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Vendor daemon: MOSEKLM
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Start-Date: Mon Feb 28 2022 09:49:15 CET
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) PID: 2147427
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) VD Version: v11.18.3.0 build 283040 x64_lsb ( build 283040 (ipv6))
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Startup/Restart Info ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Options file used: None
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Is vendor daemon a CVD: No
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Is FlexNet Licensing Service installed and compatible: No
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) FlexNet Licensing Service Version: -NA-
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Is TS accessed: No
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) TS access time: -NA-
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Number of VD restarts since LS startup: 0
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Network Info ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Listening port: 36867
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Daemon select timeout (in seconds): 1
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Host Info ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Host used in license file: hostname
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) HostID node-locked in license file: b47acd81a33c 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) HostID of the License Server: "b47acd81a33c b47acd81a33d"
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Running on Hypervisor: Not determined - treat as Physical
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) ===============================================
9:49:15 (MOSEKLM) TCP_NODELAY NOT enabled
9:49:15 (MOSEKLM) Listener Thread: running
9:49:15 (MOSEKLM) Starting diagnostics port listener thread (DPLT)
9:49:15 (MOSEKLM) Starting diagnostics output thread (DRQT)

In particular, the major information contained in the file is:

  • the port lmgrd is running on (in this case 27007, the default port used by MOSEK),

  • the port MOSEKLM is running on (in this case 36867, by default a value assigned dynamically at startup),

  • the path to the license file that was used,

  • the hostname and hostid of the machine,

  • the licensed part IDs (in this case PTS and PTON)

If the log file indicates errors consult Sec. 10.2 (Floating license issues).

Testing the Token Server

In order to verify that the token server is running, go to the Server Status TAB and click Perform Status Enquiry.

_images/flexlm-checkstatus.png

The result for a successfully running token server should be similar to the one below:

lmutil - Copyright (c) 1989-2021 Flexera. All Rights Reserved.
Flexible License Manager status on Mon 2/28/2022 10:09

License server status: 27007@hostname
    License file(s) on hostname: /home/username/mosek/mosek-floating.lic:

    hostname: license server UP (MASTER) v11.18.3

Vendor daemon status (on hostname):

   MOSEKLM: UP v11.18.3
Feature usage info:

Users of PTS:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Users of PTON:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Troubleshooting

If the server won’t start, or the client can’t check out the license first check Sec. 10.2 (Floating license issues). It covers most typical issues. Always consult the log file lmrgd.log of the server.

If that doesn’t help please contact MOSEK support at support@mosek.com. Please include the client error messages and the server log file lmgrd.log. See Sec. 10.4 (Need more help).

7.2 Linux, macOS: Token server setup

Below is a step-by-step guide to starting the token server on Linux and macOS. The same instructions can also be applied to start the token server on Windows from the command line, although for most Windows users the approach from Sec. 7.1 (Windows: Token server setup), which installs the token server as a service, is preferable.

Prerequisites and locating the files

On Linux Linux Standard Base (LSB) 3.0 or later must be installed in order for token server to work. The LSB package is called lsb-base or lsb in most Linux distributions.

The programs lmgrd and MOSEKLM required for installation can be found the bin folder inside the MOSEK installation, that is:

<MSKHOME>/mosek/10.0/tools/platform/<PLATFORM>/bin/

where <PLATFORM> is the platform you are working on.

Starting the token server

To start the token server open the terminal, go to the bin folder of the MOSEK installation mentioned above and run:

./lmgrd -c PATH_TO_LICENSE -l lmgrd.log

where PATH_TO_LICENSE is the path to your license file. The token server will save a log file in the location given by the -l command line parameter.

Checking that startup succeeded

If the token server was started successfully the lmgrd.log file will look similar to this

9:49:15 (lmgrd) -----------------------------------------------
9:49:15 (lmgrd)   Please Note:
9:49:15 (lmgrd) 
9:49:15 (lmgrd)   This log is intended for debug purposes only.

.....

9:49:15 (lmgrd) 
9:49:15 (lmgrd) -----------------------------------------------
9:49:15 (lmgrd) 
9:49:15 (lmgrd) 
9:49:15 (lmgrd) Server's System Date and Time: Mon Feb 28 2022 09:49:15 CET
9:49:15 (lmgrd) SLOG: Summary LOG statistics is enabled.
9:49:15 (lmgrd) FlexNet Licensing (v11.18.3.0 build 283040 x64_lsb) started on hostname (linux) (2/28/2022)
9:49:15 (lmgrd) Copyright (c) 1988-2021 Flexera. All Rights Reserved.
9:49:15 (lmgrd) World Wide Web:  http://www.flexerasoftware.com
9:49:15 (lmgrd) License file(s): /home/username/mosek/mosek-floating.lic
9:49:15 (lmgrd) lmgrd tcp-port 27007
9:49:15 (lmgrd) (@lmgrd-SLOG@) ===============================================
9:49:15 (lmgrd) (@lmgrd-SLOG@) === LMGRD ===
9:49:15 (lmgrd) (@lmgrd-SLOG@) Start-Date: Mon Feb 28 2022 09:49:15 CET
9:49:15 (lmgrd) (@lmgrd-SLOG@) PID: 2147425
9:49:15 (lmgrd) (@lmgrd-SLOG@) LMGRD Version: v11.18.3.0 build 283040 x64_lsb ( build 283040 (ipv6))
9:49:15 (lmgrd) (@lmgrd-SLOG@) 
9:49:15 (lmgrd) (@lmgrd-SLOG@) === Network Info ===
9:49:15 (lmgrd) (@lmgrd-SLOG@) Listening port: 27007
9:49:15 (lmgrd) (@lmgrd-SLOG@) 
9:49:15 (lmgrd) (@lmgrd-SLOG@) === Startup Info ===
9:49:15 (lmgrd) (@lmgrd-SLOG@) Server Configuration: Single Server
9:49:15 (lmgrd) (@lmgrd-SLOG@) Command-line options used at LS startup: -c /home/username/mosek/mosek-floating.lic 
9:49:15 (lmgrd) (@lmgrd-SLOG@) License file(s) used:  /home/username/mosek/mosek-floating.lic
9:49:15 (lmgrd) (@lmgrd-SLOG@) ===============================================
9:49:15 (lmgrd) Starting vendor daemons ... 
9:49:15 (lmgrd) Started MOSEKLM (internet tcp_port 36867 pid 2147427)
9:49:15 (MOSEKLM) FlexNet Licensing version v11.18.3.0 build 283040 x64_lsb
9:49:15 (MOSEKLM) SLOG: Summary LOG statistics is enabled.
9:49:15 (MOSEKLM) SLOG: FNPLS-INTERNAL-CKPT1
9:49:15 (MOSEKLM) SLOG: VM Status: 0
9:49:15 (MOSEKLM) SLOG: FNPLS-INTERNAL-CKPT5
9:49:15 (MOSEKLM) SLOG: TPM Status: 0
9:49:15 (MOSEKLM) SLOG: FNPLS-INTERNAL-CKPT6
9:49:15 (MOSEKLM) Server started on hostname for:	PTS		
9:49:15 (MOSEKLM) PTON		
9:49:15 (MOSEKLM) EXTERNAL FILTERS are OFF
9:49:15 (lmgrd) MOSEKLM using TCP-port 36867
9:49:15 (MOSEKLM) SLOG: Statistics Log Frequency is 240 minute(s).
9:49:15 (MOSEKLM) SLOG: TS update poll interval is 600 seconds.
9:49:15 (MOSEKLM) SLOG: Activation borrow reclaim percentage is 0.
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) ===============================================
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Vendor Daemon ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Vendor daemon: MOSEKLM
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Start-Date: Mon Feb 28 2022 09:49:15 CET
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) PID: 2147427
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) VD Version: v11.18.3.0 build 283040 x64_lsb ( build 283040 (ipv6))
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Startup/Restart Info ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Options file used: None
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Is vendor daemon a CVD: No
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Is FlexNet Licensing Service installed and compatible: No
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) FlexNet Licensing Service Version: -NA-
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Is TS accessed: No
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) TS access time: -NA-
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Number of VD restarts since LS startup: 0
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Network Info ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Listening port: 36867
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Daemon select timeout (in seconds): 1
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Host Info ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Host used in license file: hostname
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) HostID node-locked in license file: b47acd81a33c 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) HostID of the License Server: "b47acd81a33c b47acd81a33d"
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Running on Hypervisor: Not determined - treat as Physical
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) ===============================================
9:49:15 (MOSEKLM) TCP_NODELAY NOT enabled
9:49:15 (MOSEKLM) Listener Thread: running
9:49:15 (MOSEKLM) Starting diagnostics port listener thread (DPLT)
9:49:15 (MOSEKLM) Starting diagnostics output thread (DRQT)

In particular, the major information contained in the file is:

  • the port lmgrd is running on (in this case 27007, the default port used by MOSEK),

  • the port MOSEKLM is running on (in this case 36867, by default a value assigned dynamically at startup),

  • the path to the license file that was used,

  • the hostname and hostid of the machine,

  • the licensed part IDs (in this case PTS and PTON)

If the log file indicates errors consult Sec. 10.2 (Floating license issues).

Testing the Token Server

In order to verify that the token server is running, go to the bin folder of the MOSEK installation mentioned above and run:

./lmutil lmstat -c 27007@127.0.0.1 -a

(if necessary replace 27007 with your port number). The result for a successfully running token server should be similar to the one below:

lmutil - Copyright (c) 1989-2021 Flexera. All Rights Reserved.
Flexible License Manager status on Mon 2/28/2022 10:09

License server status: 27007@hostname
    License file(s) on hostname: /home/username/mosek/mosek-floating.lic:

    hostname: license server UP (MASTER) v11.18.3

Vendor daemon status (on hostname):

   MOSEKLM: UP v11.18.3
Feature usage info:

Users of PTS:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Users of PTON:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Troubleshooting

If the server won’t start, or the client can’t check out the license first check Sec. 10.2 (Floating license issues). It covers most typical issues. Always consult the log file lmrgd.log of the server.

If that doesn’t help please contact MOSEK support at support@mosek.com. Please include the client error messages and the server log file lmgrd.log. See Sec. 10.4 (Need more help).

If on Linux you get an error similar to:

./lmgrd: No such file or directory

then most likely the Linux Standard Base lsb package is not installed.

Starting lmgrd on boot

To start the license server automatically on boot add the above procedure to your system’s startup scripts. Details vary depending on the operating system. Note that for security reasons lmgrd should not run as root, therefore we recommend a construction such as:

su USERNAME -c "umask 022; LMGRD -c PATH_TO_LICENSE_FILE -l PATH_TO_LOG_FILE"

where

  • USERNAME is a normal, non-root, non-privileged user,

  • LMGRD is the complete path to the lmgrd binary,

  • PATH_TO_LICENSE_FILE is the complete path to the license file,

  • PATH_TO_LOG_FILE is the complete path to the debug log file.

7.3 Changing default ports and firewall and antivirus issues

The token server consists of two daemons

  • lmgrd: The token server daemon. By default it listens on port 27007.

  • MOSEKLM: A demon started by lmgrd. Opens its own port; its number can vary between runs unless explicitly specified (see below).

Both need an open port in the firewall if a MOSEK client should be able to check out a license license token. To specify explicitly which port number each daemon should use you must change the license file. The first two lines in a standard MOSEK floating license file look like

SERVER my_server 123456789ABC 27007
VENDOR MOSEKLM

To instruct lmgrd to use port 27008 and MOSEKLM to use port 3084 instead, change the first two lines of the license file to:

SERVER my_server 123456789ABC 27008
VENDOR MOSEKLM port=3084

Restart the token server and configure your firewall to allow access to the chosen port numbers, in this case 27008 and 3084.

Finally, it is a good idea to check if the port is open by using the telnet command as follows

telnet my_server 27008

on the client computer(s). If you get an error message similar to

Connecting to my_server...Could not open connection to the host,
on port 27008: Connect failed

then the port is not open. See also the License Administration Guide for more information.

Note that antivirus software can have a similar effect and also block connections, even from the same machine. In this case instruct the software to allow connections through the two ports you specify explicitly in the license file as shown above.

7.4 License Checkout Overhead

In FLEXlm version 11.13.1.2 and higher users may experience an overhead of a few tenths of a second when checking out the license token the first time. This is mainly due to additional checks the FLEXlm performs to detect virtual machines. Unfortunately it is an issue whose fixing is beyond the scope for MOSEK. FLEXlm is working on a solution to the issue.

Note that if the MOSEK environment is reused and license caching is turned on, then the issue will only be noticed for the first optimization. Please contact support@mosek.com to obtain more information if needed.