|
GettingStartedWithTheCloudToolsGrailsPlugin
Using the Cloud Tools Grails Plugin
IntroductionCloud Tools provides a Grails plugin for deploying and managing Grails application on Amazon EC2. The Grails plugin manages on or more named clusters. Each cluster consists of a set of EC2 instances. Checkout the screen cast showing how to use the plugin. InstallationYou can download the plugin from here. Alternatively, you can install the plugin using this command grails install-plugin http://cloudtools.googlecode.com/files/grails-cloud-tools-0.6.zip ConfigurationBefore you can use this plugin, you first need to edit grails-app/conf/Config.groovy. You need to specify the location of the AwsPropertiesFile and define the cluster configuration. This is what you need to add to that file. import net.chrisrichardson.ec2deployer.cluster.*
import net.chrisrichardson.ec2deployer.core.*
cloudTools {
awsPropertiesFile = "...path to AWS properties file ..."
// The name of the cluster
// The plugin creates a file called ~/.cloudtools/<clusterName>.xml directory
clusterName = "grails-cluster"
// Specify the configuration of the cluster
clusterSpec = new ClusterSpec()
.tomcats(1)
.topology("SingleInstanceTopology")
.instanceType(EC2InstanceType.SMALL)
.slaves(0)
.bucketPrefix(System.getProperty("grails.env"))
.catalinaOptsBuilder("""{builder, databasePrivateDnsName, slaves ->
builder.arg("-Xmx500m")
builder.prop("com.sun.management.jmxremote")
builder.prop("com.sun.management.jmxremote.port", 8091)
builder.prop("com.sun.management.jmxremote.authenticate", false)
builder.prop("com.sun.management.jmxremote.ssl", false)
builder.prop("ptrack.application.environment", "ec2")
builder.prop("jdbc.db.server", databasePrivateDnsName)}""")
.schema("ptrack", ["ptrack": "ptrack"], [])
}
This code creates a ClusterSpec that is used by EC2Deploy to manage the cluster. Using the pluginThe plugin provides the following scripts:
|
Sign in to add a comment