Documentation

Starting EC2 instances

You may want to automate the launch of the instances using the AWS API, but in this section, we will review the steps to start an EC2 instance manually using the AWS launch wizard.

Step 1: Choose an Amazon Machine Image (AMI)

Once you have built the AMI as explained in the previous section, you will be able to select it in the "My AMIs" tab.

Step 3: Configure Instance Details

Configuration properties are passed to the instance via EC2 User Data in step 3, section "Advanced Details" of the AWS launch wizard. Each line should be formatted as KEY=VALUE, as it is done in the grb_rs.cnf file. When building the AMI you may have set some default values in the grb_rs.cnf file and you only need to specify the properties that you need to override. The following table indicates the important properties that you may want to override. For the complete list of properties, please refer to the Remote Services Reference Manual or run the command grb_rs properties:

Key Description
HOSTNAME DNS name of the node that can be resolved from the other nodes inside the same EC2 VPC and the clients running in EC2 or on-premise. By default, grb_rs will set the HOSTNAME to the public DNS name of the instance. If you want to use another name, set this property. For example, this is useful if you defined a custom DNS name in Route53 mapped to an Elastic IP attached to this node
PORT Port to use for HTTP and HTTPS communication. Only this port needs to be open in your EC2 security group to let other nodes and clients access the cluster. By default, HTTP will use the port 80 and HTTPS the port 443. If you wish to use a different port, set this property.
CLOUDKEY Cloud key for your cloud license. You can find this value under the Downloads > Licenses menu on the Gurobi website. You will need this value to activate the full capabilities of a Compute Server.
WORKER Indicates that you do not need the full capability of a Compute Server, and that you will use this node as a Distributed Worker. You do not need a CLOUDKEY in this case.
IDLESHUTDOWN The machine will shut down automatically after being idle for the given time in minutes. If this is omitted, the machine will not shut down automatically when inactive.
CLUSTER_TOKEN Private password that enables different nodes to join the same cluster. All nodes of a cluster must have the same token. It is recommended to generate a new token using the grb_rs token command.
PASSWORD Password for clients to access the cluster. It is recommended to change the value by copying the output of the 'grb_rs hash' command. The default value is the hash of 'pass'.
ADMINPASSWORD Password for clients to access restricted administrative job operations. It is recommended to change the value by copying the output of the 'grb_rs hash' command. The default value is the hash of 'admin'
CLUSTER_ADMINPASSWORD Password for clients to access restricted administrative cluster operations. It is recommended to change the value by copying the output of the 'grb_rs hash' command. The default value is the hash of 'cluster'.
JOBLIMIT Default value of the maximum number of jobs that can run concurrently when using Compute Server. If the job limit is changed using the 'grbcluster config' command, this value will be ignored.
JOIN Defines one or more nodes to join and form a cluster. This property must contain a comma separated list of other EC2 instances DNS name to join.
JOIN_TIMEOUT defines how long this node will retry to join the cluster. As EC2 machines may take time to start, it is recommended to set a longer timeout than the default.

Here is a typical example to start a compute server:

CLOUDKEY=d67dcf8a-72b6-11e5-840b-0779f0f8b08e
PASSWORD=myAccessPassword
ADMINPASSWORD=myAdminPassword
CLUSTER_ADMINPASSWORD=myClusterAdminPassword
CLUSTER_TOKEN=myToken
IDLESHUTDOWN=60

Here is an example to start a compute server on a custom port 61000:

CLOUDKEY=d67dcf8a-72b6-11e5-840b-0779f0f8b08e
PASSWORD=myAccessPassword
ADMINPASSWORD=myAdminPassword
CLUSTER_ADMINPASSWORD=myClusterAdminPassword
CLUSTER_TOKEN=myToken
IDLESHUTDOWN=60
PORT=61000

Once you have started an EC2 instance, you can add more instances to form a cluster. Let's assume that the first EC2 instance was started with a DNS name ec2-64-82-45-124.compute-1.amazonaws.com, then you can start additional instances and set the JOIN property to this address. Note that all the passwords and the cluster token must be identical for the setup to be correct.

CLOUDKEY=d67dcf8a-72b6-11e5-840b-0779f0f8b08e
PASSWORD=myAccessPassword
ADMINPASSWORD=myAdminPassword
CLUSTER_ADMINPASSWORD=myClusterAdminPassword
CLUSTER_TOKEN=myToken
IDLESHUTDOWN=60
JOIN=ec2-64-82-45-124.compute-1.amazonaws.com

Here is a typical example to add a distributed worker:

WORKER=true
PASSWORD=myAccessPassword
ADMINPASSWORD=myAdminPassword
CLUSTER_ADMINPASSWORD=myClusterAdminPassword
CLUSTER_TOKEN=myToken
IDLESHUTDOWN=60
JOIN=ec2-64-82-45-124.compute-1.amazonaws.com

Step 6: Configure Security Group

If you want to use the default HTTP on port 80, you can set these rules:

Type Protocol Port Range Source Description
HTTP TCP 80 Set the source as necessary for your setup Gurobi Remote Services Agent
SSH TCP 22 as necessary for your setup SSH (optional) to access logs and administrate the machine

If you want to use HTTP on the custom port 61000, you can set these rules:

Type Protocol Port Range Source Description
Custom TCP rule TCP 61000 as necessary for your setup Gurobi Remote Services Agent
SSH TCP 22 Set the source as necessary for your setup SSH (optional) to access logs and administrate the machine

If you have setup HTTPS, please use the following rules:

Type Protocol Port Range Source Description
HTTPS TCP 443 as necessary for your setup Gurobi Remote Services Agent
SSH TCP 22 Set the source as necessary for your setup SSH (optional) to access logs and administrate the machine