Important note: Most Gurobi licenses do not use the token server. You should only follow these instructions if you are setting up a floating license. If you are not sure whether you need to start a token server, you can examine the contents of your gurobi.lic file. If it contains the line TYPE=TOKEN then you need a token server, except if you also have the additional lines USELIMIT=1 and MACHINELIMIT=0.
Clients of the token server also need simple license files. Your next step is to set up a client license.
Windows
On a Windows system, the executable is named grb_ts.exe. You can start the token service by selecting the Gurobi Token Server menu item from the Gurobi folder of the Start menu. You should only do so after you have installed the Gurobi license key file.
By default, the token server only produces logging output when it starts. To obtain more detailed logging information, start the token server with the -v switch. This will produce a log message each time a token is checked in or out.
The token server runs as a Windows service. If you'd like to run it in the foreground, start grb_ts (no arguments) from the command window with the -n switch. Running grb_ts -h lists all command-line options.
Once the token service has been started, you should see the grb_ts service listed in the Services tab of the Task Manager. To start or stop the service, click on the Services button at the bottom-right of the Services tab, and then right-click on the Gurobi Token Server item on this screen.
You can also start or stop the Gurobi Token Server service from a Console window with administrator privileges. Issuing a grb_ts -s command stops a running token server.
Linux
To start the Linux token server daemon, run the program grb_ts (with no arguments) on your token server machine. You only need to do this once — the token server will keep running until you stop it (or until the machine is shut down). Be sure that the license key file has been installed before running this program. Note that the token server runs as a user process, so you do not need root privileges to start it.
If you would like the token server to restart automatically when the machine is rebooted, there are a number of options for doing so; please follow the instructions in How do I automatically start the token server on Linux?
To stop a running token server, you can issue the grb_ts -s command. You can also use the ps command to find the relevant process ID, and the kill command to terminate that process.
Output from the token server goes to the system log (/var/log/syslog). You should see a message similar to the following when you start the server:
Mar 5 12:37:21 mymachine grb[7917]: Gurobi Token Server started: Sat Mar 5 12:37:21 2023
By default, the token server only produces logging output when it starts. To obtain more detailed logging information, start the token server with the -v switch. This will produce a log message each time a token is checked in or out.
The token server forks off a separate process that runs in the background. Use the -n switch to run it in the foreground instead.
macOS
To start the Mac token server daemon, run the program grb_ts (with no arguments) on your token server machine. You only need to do this once — the token server will keep running until you stop it (or until the machine is shut down). Be sure that the license key file has been installed before running this program. Note that the token server runs as a user process, so you do not need root privileges to start it.
If you would like the token server to restart when the machine is rebooted, you should ask your system administrator to start it from /etc/rc.local. If your Gurobi installation and license key file are in their default locations (either your home directory or /Library/gurobi), add the following:
/Library/gurobi1200/macos_universal2/bin/grb_ts
To stop a running token server, you can issue the grb_ts -s command. You can also use the ps command to find the relevant process ID, and the kill command to terminate that process.
Output from the token server goes to the system log (/var/log/system.log). You will need to modify /etc/syslog.conf to see these messages, since by default OS X only allows error message in the system log. Once you have modified syslog.conf, you should see a message similar to the following when you start the server:
Mar 5 12:37:21 mymachine grb[7917]: Gurobi Token Server started: Sat Mar 5 12:37:21 2023
By default, the token server only produces logging output when it starts. To obtain more detailed logging information, start the token server with the -v switch. This will produce a log message each time a token is checked in or out.
The token server forks off a separate process that runs in the background. Use the -n switch to run it in the foreground instead.
Next steps
Once your token server is running and you've set up a client license, you can test the license.
Firewalls
If you run into trouble accessing the token server, check to see if the server is running firewall software that is blocking access to some ports. The Gurobi token server uses port number 41954 by default, so you'll need to open access to that port on the server. Please consult the documentation for your firewall software to determine how to do this. If there's a conflict on the default port, you can choose a different one by adding a PORT line to both the server and the client license key files:
PORT=46325
You can choose any available port number.
Comments
0 comments
Article is closed for comments.