This article will guide you through the installation, configuration, activation, and testing of your managed Compute Server cluster.
The figure below depicts the architecture of a managed Compute Server cluster. The cluster nodes are Gurobi Compute Server(s), Cluster Manager, and Database nodes. The cluster will be managed by the cluster manager with enterprise-grade capabilities. To learn more about the differences between a self-managed and a managed Compute Server cluster, please refer to How do I set up a Gurobi Compute Server Cluster (with/without a manager)?
These instructions are valid for Compute Server nodes and Cluster Manager nodes running on a physical or a Virtual Machine. If you want to set up a Compute Server node using Docker or Kubernetes please see https://hub.docker.com/r/gurobi/compute. If you want to set up a Cluster Manager using Docker or Kubernetes please see https://hub.docker.com/r/gurobi/manager.
The instructions below assume that you want to set up k(>=1) Compute Server nodes, and use the notation cs_t for t=1,...,k, and IP_t for t=1,...,k to represent the Compute Server node t, and its IP address, respectively. Additionally, let the Cluster Manager node be mgrNode, and the database node be dbNode, with their IP addresses being mgrIP and dbIP, respectively. This article assumes that mgrNode and dbNode are different (and different from all Compute Server nodes), but it is possible to use different configurations, like for example having the Cluster Manager and the database on the same node. The specific architecture of your cluster will depend on your preferences and needs.
Installation of a managed Compute Server cluster
- Install mongodb community version. Alternatively, install DocumentDB if you are setting up a cluster in AWS or Azure CosmosDB if you are setting up a cluster in Microsoft Azure.
On every Compute Server node cs_t for t=1,...,k and the mgrNode:
On every Compute Server node cs_t for t=1,...,k (that is, all nodes except mgrNode and dbNode):
- Install Gurobi Optimizer (full installation) or upgrade Gurobi Optimizer,
- Retrieve and set up a Gurobi license for each node.
On every Compute Server node, set the environment variables GUROBI_HOME and GUROBI_SERVER_HOME to point to the installation directories of the Gurobi Optimizer and the Gurobi Remote Services package, respectively. On the Cluster Manager node mgrNode, you only have to set the environment variable GUROBI_SERVER_HOME. This step is optional but recommended. The precise paths depend on your OS:
Configuration of a managed Compute Server Cluster
On dbNode (only necessary if dbNode and mgrNode are different nodes):
- Edit the file /etc/mongod.conf by setting bindlp: dbIP
On mgrNode (only necessary if dbNode and mgrNode are different nodes):
- Update $GUROBI_SERVER_HOME/bin/grb_rsm.cnf by setting DB_URI=mongodb://dbIP:27017
For each Compute Server node t=1,...,k (that is, all nodes except mgrNode and dbNode)
- Locate and open the $GUROBI_SERVER_HOME/bin/grb_rs.cnf file.
- Change the HOSTNAME property to IP_t. Alternatively, you can set HOSTNAME to the DNS name of the node that can be resolved from the other nodes or clients in your network (see $GUROBI_SERVER_HOME/bin/grb_rs.cnf file for more details).
- Set the PORT property. For example, you can set the port of each node to the value 60100.
- Set the MANAGER property to http://mgrIP:61080. Alternatively to using mgrIP, you can use the DNS name of the node that can be resolved from the other nodes or clients in your network. Port 61080 is the default value for the manager, you can use a different port by changing the PORT property in the $GUROBI_SERVER_HOME/bin/grb_rsm.cnf file.
Activation of a managed Compute Server Cluster
- On dbNode, start mongodb (or the appropriate database), for example, by running the command
sudo systemctl start mongod
- Start the cluster
- On mgrNode, open a terminal and run
- Verify that the Cluster Manager is running by logging into its WebUI (http://mgrIP:61080). The Cluster manager initially has three default users with predefined passwords (standard user: gurobi/pass, administrator: admin/admin, system administrator: sysadmin/cluster). Log in using sysadmin/cluster to follow the steps below.
- For t=1,...,k add node cs_t to the cluster by opening a terminal and running
- On mgrNode, open a terminal and run
- Verify that the nodes have been successfully added via the cluster manager webUI (Cluster -> Nodes)
Testing your managed Compute Server Cluster
- Create a Client API key via the Cluster Manager WebUI
- Go to Accounts -> API Keys -> CREATE API KEY
- Provide the key name, description, user role, and click CREATE.
- Download the API key (gurobi.lic file).
- On a client machine with Gurobi Optimizer installed
- Save the gurobi.lic file that you downloaded in the previous step to the user's home directory (e.g., ~/). If you want to place the file in a different location, follow the instructions in Where do I place the Gurobi license file (gurobi.lic)?
- Open a terminal, and solve a sample model by running
gurobi_cl $GUROBI_HOME/examples/data/coins.lpA successful test will show an output similar to
Set parameter CSManager to value "mgrIP:61080"
Set parameter CSAPIAccessID
Set parameter CSAPISecret
Set parameter CSAppName to value "test cluster manager"
Set parameter LogFile to value "gurobi.log"
Advanced Configuration Options
This article provided a simple setup of a working Gurobi Compute Server cluster. Starting with a working Gurobi Compute Server cluster, we encourage users to explore and test various configurations for their specific needs, ranging from starting a Compute Server as a service to configuring an enterprise-grade Compute Server cluster with LDAP integration, high availability, failover, and more. The Gurobi Optimizer Reference Manual and Gurobi Remote Services document the configuration options and details.