cloudcamp scotland - using cloud without losing control

25

Upload: duncan-johnston-watt

Post on 22-Nov-2014

536 views

Category:

Documents


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Cloudcamp scotland - Using cloud without losing control
Page 2: Cloudcamp scotland - Using cloud without losing control
Page 3: Cloudcamp scotland - Using cloud without losing control
Page 4: Cloudcamp scotland - Using cloud without losing control
Page 5: Cloudcamp scotland - Using cloud without losing control
Page 6: Cloudcamp scotland - Using cloud without losing control
Page 7: Cloudcamp scotland - Using cloud without losing control
Page 8: Cloudcamp scotland - Using cloud without losing control
Page 9: Cloudcamp scotland - Using cloud without losing control
Page 10: Cloudcamp scotland - Using cloud without losing control
Page 11: Cloudcamp scotland - Using cloud without losing control
Page 12: Cloudcamp scotland - Using cloud without losing control
Page 13: Cloudcamp scotland - Using cloud without losing control
Page 14: Cloudcamp scotland - Using cloud without losing control
Page 15: Cloudcamp scotland - Using cloud without losing control

public class MyWebCluster extends AbstractApplication

implements MyWebClusterConstants {

// TODO build the application

}

Page 16: Cloudcamp scotland - Using cloud without losing control

public class MyWebCluster extends AbstractApplication

implements MyWebClusterConstants {

def web = new JBoss7Server(this, war: WAR_PATH);

{

web.configure(httpPort: "8080+");

}

}

Page 17: Cloudcamp scotland - Using cloud without losing control

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+");

}

}

Page 18: Cloudcamp scotland - Using cloud without losing control

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));

}

}

Page 19: Cloudcamp scotland - Using cloud without losing control

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));

}

}

Page 20: Cloudcamp scotland - Using cloud without losing control

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));

}

}

Page 21: Cloudcamp scotland - Using cloud without losing control
Page 22: Cloudcamp scotland - Using cloud without losing control
Page 23: Cloudcamp scotland - Using cloud without losing control
Page 25: Cloudcamp scotland - Using cloud without losing control