cloudcamp scotland - using cloud without losing control
DESCRIPTION
TRANSCRIPT
public class MyWebCluster extends AbstractApplication
implements MyWebClusterConstants {
// TODO build the application
}
public class MyWebCluster extends AbstractApplication
implements MyWebClusterConstants {
def web = new JBoss7Server(this, war: WAR_PATH);
{
web.configure(httpPort: "8080+");
}
}
public class MyWebCluster extends AbstractApplication
implements MyWebClusterConstants {
def web = new JBoss7Server(this, war: WAR_PATH);
MySqlNode mysql = new MySqlNode(this, creationScriptUrl: DB_SETUP_SQL_URL);
{
web.configure(httpPort: "8080+");
}
}
public class MyWebCluster extends AbstractApplication
implements MyWebClusterConstants {
def web = new JBoss7Server(this, war: WAR_PATH);
MySqlNode mysql = new MySqlNode(this, creationScriptUrl: DB_SETUP_SQL_URL);
{
web.configure(httpPort: "8080+").
configure(javaSysProp("brooklyn.example.db.url"),
valueWhenAttributeReady(mysql, MySqlNode.MYSQL_URL, this.&makeJdbcUrl));
}
}
public class MyWebCluster extends AbstractApplication
implements MyWebClusterConstants {
def web = new ControlledDynamicWebAppCluster(this, war: WAR_PATH);
MySqlNode mysql = new MySqlNode(this, creationScriptUrl: DB_SETUP_SQL_URL);
{
web.factory.configure(httpPort: "8080+").
configure(javaSysProp("brooklyn.example.db.url"),
valueWhenAttributeReady(mysql, MySqlNode.MYSQL_URL, this.&makeJdbcUrl));
}
}
public class MyWebCluster extends AbstractApplication
implements MyWebClusterConstants {
def web = new ControlledDynamicWebAppCluster(this, war: WAR_PATH);
MySqlNode mysql = new MySqlNode(this, creationScriptUrl: DB_SETUP_SQL_URL);
{
web.factory.configure(httpPort: "8080+").
configure(javaSysProp("brooklyn.example.db.url"),
valueWhenAttributeReady(mysql, MySqlNode.MYSQL_URL, this.&makeJdbcUrl));
web.cluster.addPolicy(
new AutoscalerPolicy(DynamicWebAppCluster.AVERAGE_REQUESTS_PER_SECOND).
setSizeRange(1, 5).
setMetricRange(10, 100));
}
}