A Remote Services Router may be used when you need to isolate better the cluster from the clients. Without a router, the clients need to have direct access to each node in the cluster and the node DNS name and IP address must be accessible from the clients.
Instead, a router provides a point of contact for all clients and will route the communication to the appropriate node in the cluster. A Remote Services Router acts as a reverse proxy. Behind a router, the cluster nodes can use private DNS names or IP addresses as long as all the nodes and the router can communicate together. Only the router must be accessible from the clients.
In addition, the router will use HTTP as default and can also use HTTPS so that the data can be encrypted from the clients to the router. The router can then route the traffic using HTTPS or HTTP depending on the configuration of the cluster. It is a common configuration to enable HTTPS only between the clients and the router while having the router and the nodes communicate over unencrypted HTTP in a private network. Using this setup you only have to manage certificates on the router.
You can get mopre information about the router (grb_rsr) by reading the command line help:
The router uses a configuration file grb_rsr.cnf that must be placed in the same directory as grb_rsr executable. A predefined configuration file with additional comments is provided. The following commands lists the available configuration properties:
In a similar way to grb_rs, the router can be started as a service and the log messages will be stored in the grbrsr-service.log rotating file by default. The log messages will also be sent to the syslog on mac and linux, and to the service event log on Windows.
We will refer to the router URL as the full URL to access the router over HTTP or HTTPS and using standard port or a custom one. Here are some examples:
http://router.mycompany.com http://router.mycompany.com:61001 https://router.mycompany.com https://router.mycompany.com:61001
When using the command line tools grbcluster or gurobi_cl, you can specify the router URL using the --router flag. You can also add the property ROUTER to your license file. For example, once you have configured and started the router and your cluster, you can display the cluster status with the following command:
> grbcluster --router=http://router.mycompany.com --server=server1 ---password=pass nodes ADDRESS STATUS TYPE LICENSE #Q #R JL IDLE %MEM %CPU server1 ALIVE COMPUTE VALID 0 0 2 46h59m 9.79 0.50 server2 ALIVE COMPUTE VALID 0 0 2 46h46m 8.75 0.00
For the clients using the Gurobi Optimizer API, you will need to
either set the ROUTER property in the license file or construct
an empty environment and set the
CSRouter parameter before
starting the environment.
For clients using the cluster REST API for monitoring purpose, you will need to use the router URL instead of a node address, and you can pass the selected node address in the header X-GUROBI-SERVER. This way, the client communicates with the router and the router will use the header value to forward the request to the selected node. In case the node address is incorrect or does not exist, the router will return the HTTP error code 502.