Cloud Integration

As of 4.1, Corus supports “cloud integration", that is: a Corus instance can be configured through "user data", which makes it easy to start Corus nodes and assign to them configuration parameters dynamically.

Basics

When setting up Corus for cloud deployment, the basic configuration elements that are required are the following:

  • The domain name of the Corus node being started.
  • The discovery parameters (since IP multicast is usually not available in the cloud, usage of Avis or RabbitMQ must be configured – see the Discovery section for more details).

A preferred way to deploy Corus in the cloud is to configure an instance as a repository server (see the Repository section for more details), and the others as repository clients: newly appearing repo clients will thus automatically synchronize themselves with the repo server instance at startup.

The advantage of using Corus in the cloud in such a manner is that you only need configuring a single machine image with a Corus installation, and decide thereafter, through custom user data configuration, what their actual startup parameters will be.

Corus expects user data to be available at a predefined URL. In the case of AWS for example, user data can be fetched from the following:

http://169.254.169.254/latest/user-data

The content that is available at that endpoint is configurable through the AWS admin tools.

Corus, for its part, expects a JSON document corresponding to the following structure:

{
  "corus": {
    "server": {
      "properties": [
        {
          "name": "corus.server.domain",
          "value": "prod-01"
        },
        {
          "name": "ubik.rmi.naming.broadcast.provider",
          "value": "ubik.rmi.naming.broadcast.avis "
        },
        {
          "name": "ubik.rmi.naming.broadcast.avis.url",
          "value": "elvin:\/\/10.0.1.11"
        }
      ],
      "tags": [
        "scheduler",
        "read-write"
      ]
    },
    "processes": {
      "properties": [
        {
          "name": "jdbc.connections.max",
          "value": "50"
        }
      ]
    }
  }
}

The above shows that the following can be configured:

  • Corus server configuration properties
  • Corus server tags
  • Process properties

In order for the fetching of user data to be enabled, the -u option must be specified as part of the Corus server command-line. If you start Corus as a daemon process, this involves either modifying the Corus configuration for the Java Service Wrapper, or the Corus init.d script (if you're not using the Java Service Wrapper).

Note that the -u option does not have to have a value. In such a case, Corus will attempt fetch the user data JSON document from the following endpoints by default (in the specified order):

  1. http://169.254.169.254/latest/user-data
  2. http://169.254.169.254/openstack/latest/user-data

The first endpoint corresponds to AWS' user data endpoint, the second to Open Stack's.

Modifying the JSW Configuration

If you're starting Corus with the Java Service Wrapper, you have to modify your corus.service.wrapper.properties file. The file holds configuration parameters that are used to configure command-line arguments and options that are passed to the Corus server command-line. Look for the section corresponding holding the following parameters:

wrapper.app.parameter.1=-c
wrapper.app.parameter.2=%CORUS_CONFIG_FILE% 
wrapper.app.parameter.3=-v 
wrapper.app.parameter.4=INFO 
wrapper.app.parameter.5=-f

Add the following parameter:

wrapper.app.parameter.6=-u

If you want to explicitly specify the enpoint from which to fetch user data, add it as another parameter. For example:

wrapper.app.parameter.6=-u 
wrapper.app.parameter.7=http://169.254.169.254/latest/user-data

Modifying the init.d Script

If you're not using the Java Service Wrapper, but are rather using the plain-vanilla init.d script that's provided as part of the Corus distribution, then modify it by adding the -u option to the javaArgs parameter:

javaArgs="-Dcorus_instance=$javaCommandLineKeyword $CORUS_OPTS -cp $CLASSPATH org.sapia.corus.core.CorusServer -p $CORUS_PORT -v $CORUS_LOG_LEVEL -f $serviceLogDir -u"

Or if you want to specify the URL explicitly:

javaArgs="-Dcorus_instance=$javaCommandLineKeyword $CORUS_OPTS -cp $CLASSPATH org.sapia.corus.core.CorusServer -p $CORUS_PORT -v $CORUS_LOG_LEVEL -f $serviceLogDir -u http://169.254.169.254/latest/user-data"