Return-Path: X-Original-To: apmail-brooklyn-commits-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5158ECD3B for ; Fri, 9 Jan 2015 15:35:09 +0000 (UTC) Received: (qmail 95023 invoked by uid 500); 9 Jan 2015 15:35:10 -0000 Delivered-To: apmail-brooklyn-commits-archive@brooklyn.apache.org Received: (qmail 94993 invoked by uid 500); 9 Jan 2015 15:35:10 -0000 Mailing-List: contact commits-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list commits@brooklyn.incubator.apache.org Received: (qmail 94980 invoked by uid 99); 9 Jan 2015 15:35:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jan 2015 15:35:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD,URIBL_DBL_ABUSE_REDIR,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 09 Jan 2015 15:34:55 +0000 Received: (qmail 92600 invoked by uid 99); 9 Jan 2015 15:34:30 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jan 2015 15:34:30 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C2BB8816298; Fri, 9 Jan 2015 15:34:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: heneveld@apache.org To: commits@brooklyn.incubator.apache.org Date: Fri, 09 Jan 2015 15:34:49 -0000 Message-Id: <56cb29bbbf524c94943d018ff3a095b5@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [20/44] incubator-brooklyn git commit: moving around docs more X-Virus-Checked: Checked by ClamAV on apache.org http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/start/walkthrough/index.md ---------------------------------------------------------------------- diff --git a/docs/guide/start/walkthrough/index.md b/docs/guide/start/walkthrough/index.md deleted file mode 100644 index 3c29484..0000000 --- a/docs/guide/start/walkthrough/index.md +++ /dev/null @@ -1,239 +0,0 @@ ---- -layout: guide-normal -title: Walkthrough ---- -{% include fields.md %} - -## Intro - -Brooklyn makes it easy to describe the structure and management of sophisticated distributed applications, -and then it makes it easy to launch them in a cloud, with on-going automated management. - -This walkthrough will set up a sample application which you can use as foundation for creating your own applications. - -The sample application is a three tier web service, composed of: - -* an Nginx load-balancer -* a cluster of JBoss appservers -* a MySQL database - - -## Download the Sample Project - -If you'd like to follow these steps on your machine, you can use Maven to -download the Brooklyn quickstart archetype and setup a `brooklyn-sample` directory and project. -Maven will automatically download Brooklyn and all dependencies. -You can of course follow this walkthrough without installing it on your machine ... yet! - -{% if SNAPSHOT %} - -{% highlight bash %} -$ export BROOKLYN_VERSION=0.7.0-SNAPSHOT -$ mvn archetype:generate \ - -DarchetypeGroupId=io.brooklyn \ - -DarchetypeArtifactId=brooklyn-archetype-quickstart \ - -DarchetypeVersion=${BROOKLYN_VERSION} \ - -DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/archetype-catalog.xml \ - -DgroupId=com.acme.sample \ - -DartifactId=brooklyn-sample \ - -Dversion=0.1.0-SNAPSHOT \ - -Dpackage=com.acme.sample.brooklyn \ - --batch-mode -$ cd brooklyn-sample -{% endhighlight %} - -*Note*: As this is a snapshot version of Brooklyn, the code above includes a `-DarchetypeCatalog` specification. -This can be omitted for release versions, or if you already have a local `mvn install` of Brooklyn installed as described [here]({{site.path.guide}}/dev/code/index.html). - -{% else %} - -{% highlight bash %} -$ export BROOKLYN_VERSION=0.7.0-SNAPSHOT -$ mvn archetype:generate \ - -DarchetypeGroupId=io.brooklyn \ - -DarchetypeArtifactId=brooklyn-archetype-quickstart \ - -DarchetypeVersion=${BROOKLYN_VERSION} \ - -DgroupId=com.acme.sample \ - -DartifactId=brooklyn-sample \ - -Dversion=0.1.0-SNAPSHOT \ - -Dpackage=com.acme.sample.brooklyn -$ cd brooklyn-sample -{% endhighlight %} - -{% endif %} - -## Define your Application Blueprint - -An application blueprint is defined as a Java class, as follows: - -{% highlight java %} -public class ClusterWebServerDatabaseSample extends AbstractApplication { - @Override - public void init() { - MySqlNode mysql = addChild(EntitySpec.create(MySqlNode.class)); - ControlledDynamicWebAppCluster web = addChild(EntitySpec.create(ControlledDynamicWebAppCluster.class)); - } -} -{% endhighlight %} - -The file `ClusterWebServerDatabaseSample.java` in `src/main/java/com/acme/sample/brooklyn/sample/app/` -provides a template to follow. - - -## Deploying the Application - -If you have not already done so, follow the section in the -[Getting Started Guide]({{site.path.guide}}/use/guide/quickstart/index.html) to create a `brooklyn.properties` -file containing credentials for your preferred cloud provider. - -To launch this application, build the project and run the `start.sh` script in the resulting assembly: - -{% highlight bash %} -$ mvn clean assembly:assembly - -$ cd target/brooklyn-sample-0.1.0-SNAPSHOT-dist/brooklyn-sample-0.1.0-SNAPSHOT/ - -$ ./start.sh launch \ - --app com.acme.sample.brooklyn.sample.app.ClusterWebServerDatabaseSample \ - --location jclouds:aws-ec2:eu-west-1 -{% endhighlight %} - -(Amazon is used in this walkthrough, but lots of targets are supported, -including `--location localhost`, fixed IP addresses, and -everything supported by [jclouds](http://jclouds.org), from OpenStack to Google Compute.) - -Your console will inform you that it has started a Brooklyn console at [http://localhost:8081](http://localhost:8081) - -[![Web Console](wt-starting-700.png "Web Console")](wt-starting.png) - -The management console provides a view on to the entities that launched, -including the hierarchy (appservers grouped into a cluster) and their locations. - -Brooklyn collects information from these entities ("sensors"), -aggregates these for clusters and other groups (using "enrichers"), -and exposes operations ("effectors") that can be performed on entities. - -[![Web Console Details](wt-tree-jboss-sensors-700.png "Web Console Details")](wt-tree-jboss-sensors.png) - - -## Topology, Dependencies, and Management Policies - -Of course in the real world, application deployments are more interesting; -they do things and need configuration. For instance you might need to: - -* specify a WAR file -* initialize the database -* tell the webapp servers where to find the database - -Let's show how these are done using Brooklyn. -We assume the WAR file and the database init script are accessible -on the classpath, but a range of URL formats is supported. -The "dependent inter-process configuration" -- giving the database's URL -to the webapps -- we'll do here with a JVM system property, -but you're free to use any mechanism you wish. - -Under the covers, ``attributeWhenReady`` is monitoring a sensor from MySQL -and generating a string to pass to the webapp software processes; ``formatString`` -is a similar utility that returns a string once all of its parts have been resolved. -Due to the use of futures, the Brooklyn webapp entities will automatically -block "at the last moment" when the value is needed -(but after e.g. the VMs have been provisioned, to speed things up). - -{% highlight java %} -public class ClusterWebServerDatabaseSample extends AbstractApplication { - @Override - public void init() { - MySqlNode mysql = addChild(EntitySpec.create(MySqlNode.class) - .configure(MySqlNode.CREATION_SCRIPT_URL, "classpath://visitors-database-setup.sql")); - - ControlledDynamicWebAppCluster web = addChild(EntitySpec.create(ControlledDynamicWebAppCluster.class) - .configure("memberSpec", EntitySpec.create(JBoss7Server.class) - .configure("httpPort", "8080+") - .configure("war", WAR_PATH) - .configure(JavaEntityMethods.javaSysProp("brooklyn.example.db.url"), - formatString("jdbc:%s%s?user=%s\\&password=%s", - attributeWhenReady(mysql, MySqlNode.MYSQL_URL), DB_TABLE, DB_USERNAME, DB_PASSWORD)))); - } -} -{% endhighlight %} - -We now see our app at the Nginx URL: - -[![Our Web App](wt-deployed-application-700.png "Screenshot of our Web App")](wt-deployed-application.png) - -Finally, we'll bring in some active management: we're going to monitor requests per second, -and scale out if this exceeds 100 up to a maximum of 5 servers. -This is a naively simple policy, but it shows Brooklyn's real metier, -running management policies for applications whose topology it knows. - -{% highlight java %} - web.getCluster().addPolicy(AutoScalerPolicy.builder(). - metric(DynamicWebAppCluster.AVERAGE_REQUESTS_PER_SECOND). - sizeRange(1, 5). - metricRange(10, 100). - build()); -{% endhighlight %} - -*Policies* in Brooklyn typically subscribe to sensors, perform some computation, and if necessary invoke effectors on entities. This is where the ability to group entities -becomes very useful -- policies can be attached to group entities, and groups themselves can be hierarchical. It's also handy that often Brooklyn creates the entities, -so it knows what the hierarchy is. - -Under the covers, this ``AutoScalerPolicy`` attaches to any ``Resizable`` entity (exposing a ``resize`` effector), and monitors a specified sensor (or function) attempting to keep it within healthy limits. A separate policy operates at the ``Controlled`` cluster to ensure the load-balancer is updated as the pool of web servers expands and contracts. - -Fire up a JMeter session (or other load testing tool) and blast the Nginx address. The auto-scaler policy will scale up the cluster. - -## What Next? - -In addition to the sample project created by the archetype, with its README and -`assembly` build, you can find additional code related to this example included with Brooklyn as the ``simple-web-cluster`` example, -described [in detail here]({{site.path.guide}}/use/examples/webcluster). - -For your applications, you might want to mix in other data stores, messaging systems, or on-line services including PaaS. -Brooklyn supports some of these out-of-the-box, including a wide-range of tools which it can use Whirr to provision, such as Hadoop. -But if you have something you don't see, -[let us know]({{site.path.guide}}/meta/contact.html) -- -we want to work with you to -[write a new entity]({{site.path.guide}}/dev/code/entity.html) or -[policy]({{site.path.guide}}/dev/code/policy.html) -and [contribute it]({{site.path.guide}}/dev/how-to-contrib.html). - - - http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/start/walkthrough/wt-deployed-application-700.png ---------------------------------------------------------------------- diff --git a/docs/guide/start/walkthrough/wt-deployed-application-700.png b/docs/guide/start/walkthrough/wt-deployed-application-700.png deleted file mode 100644 index 7ef90d9..0000000 Binary files a/docs/guide/start/walkthrough/wt-deployed-application-700.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/start/walkthrough/wt-deployed-application.png ---------------------------------------------------------------------- diff --git a/docs/guide/start/walkthrough/wt-deployed-application.png b/docs/guide/start/walkthrough/wt-deployed-application.png deleted file mode 100644 index 751402e..0000000 Binary files a/docs/guide/start/walkthrough/wt-deployed-application.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/start/walkthrough/wt-starting-700.png ---------------------------------------------------------------------- diff --git a/docs/guide/start/walkthrough/wt-starting-700.png b/docs/guide/start/walkthrough/wt-starting-700.png deleted file mode 100644 index c87a539..0000000 Binary files a/docs/guide/start/walkthrough/wt-starting-700.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/start/walkthrough/wt-starting.png ---------------------------------------------------------------------- diff --git a/docs/guide/start/walkthrough/wt-starting.png b/docs/guide/start/walkthrough/wt-starting.png deleted file mode 100644 index 970805f..0000000 Binary files a/docs/guide/start/walkthrough/wt-starting.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/start/walkthrough/wt-tree-jboss-sensors-700.png ---------------------------------------------------------------------- diff --git a/docs/guide/start/walkthrough/wt-tree-jboss-sensors-700.png b/docs/guide/start/walkthrough/wt-tree-jboss-sensors-700.png deleted file mode 100644 index 3dfc7f2..0000000 Binary files a/docs/guide/start/walkthrough/wt-tree-jboss-sensors-700.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/start/walkthrough/wt-tree-jboss-sensors.png ---------------------------------------------------------------------- diff --git a/docs/guide/start/walkthrough/wt-tree-jboss-sensors.png b/docs/guide/start/walkthrough/wt-tree-jboss-sensors.png deleted file mode 100644 index 4c44ea9..0000000 Binary files a/docs/guide/start/walkthrough/wt-tree-jboss-sensors.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/yaml/defining-applications/common-usage.md ---------------------------------------------------------------------- diff --git a/docs/guide/yaml/defining-applications/common-usage.md b/docs/guide/yaml/defining-applications/common-usage.md deleted file mode 100644 index a3beed6..0000000 --- a/docs/guide/yaml/defining-applications/common-usage.md +++ /dev/null @@ -1,145 +0,0 @@ ---- -title: Common Usage -layout: guide-normal -toc: ../guide_toc.json -categories: [use, guide, defining-applications] ---- - -### Entity Class Hierarchy - -By convention in Brooklyn the following words have a particular meaning, both as types (which extend ``Group``, which extends ``Entity``) and when used as words in other entities (such as ``TomcatFabric``): - -- *Cluster* - a homogeneous collection of entities -- *Fabric* - a multi-location collection of entities, with one per location; often used with a cluster per location -- *Stack* - heterogeneous (mixed types of children) -- *Application* - user's entry point - - - -- *entity spec* defines an entity, so that one or more such entities can be created; often used by clusters/groups to define how to instantiate new children. -- *entity factories* are often used by clusters/groups to define how to instantiate new children. -- *traits* (mixins) providing certain capabilities, such as Resizable and Balanceable -- *Resizable* entities can re-sized dynamically, to increase/decrease the number of child entities. -- *Movable* entities can be migrated between *balanceable containers*. -- *Balanceable containers* can contain *movable* entities, where each contained entity is normally associated with - a piece of work within that container. - -### Off-the-Shelf Entities - -brooklyn includes a selection of entities already available for use in applications, -including appropriate sensors and effectors, and in some cases include Cluster and Fabric variants. -(These are also useful as templates for writing new entities.) - -These include: - -- **Web**: Tomcat, JBoss, Jetty (external), Play (external); nginx; GeoScaling -- **Data**: MySQL, Redis, MongoDB, Infinispan, GemFire (external) -- **Containers**: Karaf -- **Messaging**: ActiveMQ, Qpid, Rabbit MQ -- **PaaS**: Cloud Foundry, Stackato; OpenShift - - -### Off-the-Shelf Locations - - - -Brooklyn supports deploying to any machine which admits SSH access, as well as to -a huge variety of external and on-premise clouds. You can also connect to services, -or use whatever technique for deployment suits you best (such as Xebia Overthere, in development!). - -Configuration is typically set in `~/.brooklyn/brooklyn.properties` using keys such as the following: - -{% highlight bash %} -# use this key for localhost (this is the default, although if you have a passphrase you must set it) -brooklyn.location.localhost.privateKeyFile=~/.ssh/id_rsa - -brooklyn.location.localhost.privateKeyPassphrase=s3cr3tPASSPHRASE - -# use a special key when connecting to public clouds, and a particularly special one for AWS -brooklyn.location.jclouds.privateKeyFile=~/.ssh/public_clouds/id_rsa -brooklyn.location.jclouds.aws-ec2.privateKeyFile=~/.ssh/public_clouds/aws_id_rsa - -# AWS credentials (when deploying to location jclouds:aws-ec2) -brooklyn.location.jclouds.aws-ec2.identity=ABCDEFGHIJKLMNOPQRST -brooklyn.location.jclouds.aws-ec2.credential=s3cr3tsq1rr3ls3cr3tsq1rr3ls3cr3tsq1rr3l - -# credentials for 'geoscaling' service -brooklyn.geoscaling.username=cloudsoft -brooklyn.geoscaling.password=xxx -{% endhighlight %} - -These can also be set as environment variables (in the shell) or system properties (java command line). -(There are also ``BROOKLYN_JCLOUDS_PRIVATE_KEY_FILE`` variants accepted.) - -For any jclouds provider you will typically need to set ``identity`` and ``credential`` -in the ``brooklyn.location.jclouds.provider`` namespace. - -To deploy to sets of machines with known IP's, assuming you have the credentials, -use the syntax ``byon:(hosts="user@10.9.1.1,user@10.9.1.2,user@10.9.1.3")`` -(this requires your default private key to have access; -see the ``prod1`` example below for specifying other credentials). - -A wide range of other fields is available, because in the real world sometimes things do get complicated. -The following is supported from the configuration file (with whatever customization you might want available in code): - -- If there is a passphrase on the key file being used, you must supply it to Brooklyn for it to work, of course! - ``privateKeyPassphrase`` does the trick (as in ``brooklyn.location.jclouds.privateKeyPassphrase``, or other places - where ``privateKeyFile`` is valid). If you don't like keys, you can just use a plain old ``password``. - -- Hardware requirements such as ``minRam`` and ``minCores`` can be supplied, or a ``hardwareId`` (jclouds only) - -- Specific Secury Groups can be specified using `securityGroups`, if you want to reuse set of existing ones (jclouds only) - -- Specific KeyPair can be specified using `keyPair`, if you want to reuse an existing keypair (jclouds only). - -- Specific VM images can be specified using ``imageId`` or ``imageNameRegex`` (jclouds only) - -- User metadata can be attached, using the syntax ``userMetadata=key=value,key2="value 2"`` (jclouds only) - -- A ``user`` can be specified, with the property that -- in a jclouds world -- the user will be *created* on the machine, - with admin rights, authorizing the relevant public key (corresponding to the private key, or as described below). - Login for the root account will be disabled, as will login by password if a public key is supplied. - (This is skipped if ``user`` is the ``root`` or other initial login user.) - -- You can specify the user account to use to login to jclouds initially with the ``loginUser`` property. - Typically this is auto-detected by jclouds - (often ``root``, or ``ubuntu`` or ``ec2-user`` for known Ubuntu or Amazon Linux images), - but the strategy isn't foolproof, particularly in some private cloud setups. (jclouds only). In some cases, you may need to specify a `loginUser.privateKeyFile` if the image you are using doesn't allow ssh password login. - -- Public keys can be specified using ``publicKeyFile``, - although these can usually be omitted if they follow the common pattern of being - the private key file with the suffix ``.pub`` appended. - (It is useful in the case of ``loginUser.publicKeyFile``, where you shouldn't need, - or might not even have, the private key of the ``root`` user in order to log in.) - -- You can specify the number of attempts Brooklyn should make to create - machines with ``machineCreateAttempts`` (jclouds only). This is useful for - working around the rare occasions in which cloud providers give machines that - are dead on arrival. - -You can also define named locations for commonly used groups of properties, -with the syntax ``brooklyn.location.named.your-group-name.`` -followed by the relevant properties. -These can be accessed at runtime using the syntax ``named:your-group-name`` as the deployment location. - -Some more advanced examples showing the syntax and properties above are as follows: - -{% highlight bash %} -# Production pool of machines for my application (deploy to named:prod1) -brooklyn.location.named.prod1=byon:(hosts="10.9.1.1,10.9.1.2,produser2@10.9.2.{10,11,20-29}") -brooklyn.location.named.prod1.user=produser1 -brooklyn.location.named.prod1.privateKeyFile=~/.ssh/produser_id_rsa -brooklyn.location.named.prod1.privateKeyPassphrase=s3cr3tCOMPANYpassphrase - -# AWS using my company's credentials and image standard, then labelling images so others know they're mine -brooklyn.location.named.company-jungle=jclouds:aws-ec2:us-west-1 -brooklyn.location.named.company-jungle.identity=BCDEFGHIJKLMNOPQRSTU -brooklyn.location.named.company-jungle.privateKeyFile=~/.ssh/public_clouds/company_aws_id_rsa -brooklyn.location.named.company-jungle.imageId=ami-12345 -brooklyn.location.named.company-jungle.minRam=2048 -brooklyn.location.named.company-jungle.userMetadata=application=my-jungle-app,owner="Bob Johnson" -brooklyn.location.named.company-jungle.machineCreateAttempts=2 -{% endhighlight %} - http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/yaml/defining-applications/example_files/tomcat_multi-location.java ---------------------------------------------------------------------- diff --git a/docs/guide/yaml/defining-applications/example_files/tomcat_multi-location.java b/docs/guide/yaml/defining-applications/example_files/tomcat_multi-location.java deleted file mode 100644 index cb92766..0000000 --- a/docs/guide/yaml/defining-applications/example_files/tomcat_multi-location.java +++ /dev/null @@ -1,15 +0,0 @@ -// TODO Untested code; see brooklyn-example for better maintained examples! -public class TomcatFabricApp extends AbstractApplication { - @Override - public void init() { - addChild(EntitySpec.create(DynamicFabric.class) - .configure("displayName", "WebFabric") - .configure("displayNamePrefix", "") - .configure("displayNameSuffix", " web cluster") - .configure("memberSpec", EntitySpec.create(ControlledDynamicWebAppCluster.class) - .configure("initialSize", 2) - .configure("memberSpec", : EntitySpec.create(TomcatServer.class) - .configure("httpPort", "8080+") - .configure("war", "/path/to/booking-mvc.war")))); - } -} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/yaml/defining-applications/example_files/tomcat_nginx.java ---------------------------------------------------------------------- diff --git a/docs/guide/yaml/defining-applications/example_files/tomcat_nginx.java b/docs/guide/yaml/defining-applications/example_files/tomcat_nginx.java deleted file mode 100644 index 20db33d..0000000 --- a/docs/guide/yaml/defining-applications/example_files/tomcat_nginx.java +++ /dev/null @@ -1,17 +0,0 @@ -// TODO Untested code; see brooklyn-example for better maintained examples! -public class TomcatClusterWithNginxApp extends AbstractApplication { - @Override - public void init() { - addChild(EntitySpec.create(NginxController.class) - .configure("domain", "brooklyn.geopaas.org") - .configure("port", "8000+") - .configure("portNumberSensor", Attributes.HTTP_PORT)); - - addChild(EntitySpec.create(ControlledDynamicWebAppCluster.class) - .configure("controller", nginxController) - .configure("memberSpec", : EntitySpec.create(TomcatServer.class) - .configure("httpPort", "8080+") - .configure("war", "/path/to/booking-mvc.war")) - .configure("initialSize", 2)); - } -} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/yaml/defining-applications/example_files/tomcat_simple.java ---------------------------------------------------------------------- diff --git a/docs/guide/yaml/defining-applications/example_files/tomcat_simple.java b/docs/guide/yaml/defining-applications/example_files/tomcat_simple.java deleted file mode 100644 index 480a333..0000000 --- a/docs/guide/yaml/defining-applications/example_files/tomcat_simple.java +++ /dev/null @@ -1,9 +0,0 @@ -// TODO Untested code; see brooklyn-example for better maintained examples! -public class TomcatServerApp extends AbstractApplication { - @Override - public void init() { - addChild(EntitySpec.create(TomcatServer.class) - .configure("httpPort", "8080+") - .configure("war", "/path/to/booking-mvc.war"))); - } -} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/yaml/defining-applications/examples.md ---------------------------------------------------------------------- diff --git a/docs/guide/yaml/defining-applications/examples.md b/docs/guide/yaml/defining-applications/examples.md deleted file mode 100644 index 330b6d3..0000000 --- a/docs/guide/yaml/defining-applications/examples.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Examples -layout: guide-normal -toc: ../guide_toc.json -categories: [use, guide, defining-applications] ---- - -** TODO: this examples page is deprecated; -code is out-of-date, and better examples are described on the web site. -need to figure out if this page should be kept at all -(indeed if the "guide" is even still relevant)** - - -### Integrating with a Maven project - -If you have a Maven-based project, integrate this XML fragment with your pom.xml: - - - -{% highlight xml %} - - - io.brooklyn - brooklyn-all - 0.7.0-SNAPSHOT - - - - - cloudsoft-releases - http://developers.cloudsoftcorp.com/download/maven2/ - - - libs-snapshot-local - http://ccweb.cloudsoftcorp.com/maven/libs-snapshot-local/ - - true - never - fail - - -{% endhighlight %} - - -### Starting a Tomcat Server - -The code below starts a Tomcat server on the local machine. - -The ``main`` method defines the application, and passes it to the ``BrooklynLauncher`` to be managed. -It is then started in a localhost location (other locations are shown in the next section). - -The Tomcat's configuration indicates that the given WAR should be deployed to the Tomcat server when it is started. - -{% highlight java %} -{% readj example_files/tomcat_simple.java %} -{% endhighlight %} - -The ``wars`` config is also supported (with config keys ``ROOT_WAR`` and ``NAMED_WARS`` the long-hand syntax); -they accept EARs and other common archives, and can be described as files or as URLs (as Strings), -with URLs supporting an optional ``classpath://org/acme/resources/xxx.war`` syntax. - - -### Starting Tomcat in Amazon EC2 - -To start a tomcat node or cluster in Amazon EC2, the application is identical to that for localhost. -The only difference is the location supplied. - -The Brooklyn CLI can be used to launch the application in your choice of location, such as: - -{% highlight bash %} -brooklyn launch --app TomcatServerApp --location localhost -brooklyn launch --app TomcatServerApp --location aws-ec2:eu-west-1 -{% endhighlight %} - - -### Starting a Tomcat Cluster with Nginx - -The code below starts a Tomcat cluster along with an Nginx instance, where each Tomcat server in the cluster is registered with the Nginx instance. - -{% highlight java %} -{% readj example_files/tomcat_nginx.java %} -{% endhighlight %} - -This creates a cluster that of Tomcat servers, along with an Nginx instance. The ``NginxController`` instance -is notified whenever a member of the cluster joins or leaves; the entity is configured to look at the ``HTTP_PORT`` -attribute of that instance so that the Nginx configuration can be updated with the ip:port of the cluster member. - - - - -Starting a Multi-location Tomcat Fabric ---------------------------------------- - - - - - -The ``ControlledDynamicWebAppCluster`` entity used above can also be used with a DynamicFabric to start -a web-cluster in each location. - -{% highlight java %} -{% readj example_files/tomcat_multi-location.java %} -{% endhighlight %} - - -Examples Source ---------------- - -Source code for (more up-to-date!) examples is available for download from GitHub. To retrieve the source, execute the following command: - - git clone git@github.com:apache/incubator-brooklyn.git - cd incubator-brooklyn/examples - -You can also [browse the code](https://github.com/apache/incubator-brooklyn/tree/examples) on the web. http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/guide/yaml/index.md ---------------------------------------------------------------------- diff --git a/docs/guide/yaml/index.md b/docs/guide/yaml/index.md index a32ac59..8914250 100644 --- a/docs/guide/yaml/index.md +++ b/docs/guide/yaml/index.md @@ -6,8 +6,6 @@ children: - defining-applications/deploying-yaml.md - defining-applications/catalog-maintenance.md - defining-applications/chef-blueprints.md -- defining-applications/common-usage.md -- defining-applications/examples.md - defining-applications/yaml-reference.md --- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/index.md ---------------------------------------------------------------------- diff --git a/docs/website/index.md b/docs/website/index.md index aa180f7..f210d6e 100644 --- a/docs/website/index.md +++ b/docs/website/index.md @@ -5,7 +5,7 @@ landing: true children: - learnmore/ - { path: download/, menu: null } -- { path: quickstart/, title: Get Started } +- { path: /guide/start/blueprints.md, title: Get Started } - path: documentation/ menu: - { path: /guide/index.md, title_in_menu: "User Guide", http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/_my-web-cluster.yaml ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/_my-web-cluster.yaml b/docs/website/quickstart/_my-web-cluster.yaml deleted file mode 100644 index 3b6134b..0000000 --- a/docs/website/quickstart/_my-web-cluster.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: My Web Cluster -location: location -services: - -- serviceType: brooklyn.entity.webapp.ControlledDynamicWebAppCluster - name: My Web - brooklyn.config: - wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/{{ site.data.brooklyn.version }}/brooklyn-example-hello-world-sql-webapp-{{ site.data.brooklyn.version }}.war - java.sysprops: - brooklyn.example.db.url: > - $brooklyn:formatString("jdbc:%s%s?user=%s\\&password=%s", - component("db").attributeWhenReady("datastore.url"), - "visitors", "brooklyn", "br00k11n") - -- serviceType: brooklyn.entity.database.mysql.MySqlNode - id: db - name: My DB - brooklyn.config: - creationScriptUrl: https://bit.ly/brooklyn-visitors-creation-script \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/catalog.xml ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/catalog.xml b/docs/website/quickstart/catalog.xml deleted file mode 100644 index 6cff554..0000000 --- a/docs/website/quickstart/catalog.xml +++ /dev/null @@ -1,22 +0,0 @@ - - Brooklyn Demos - - - - - - - - https://oss.sonatype.org/service/local/artifact/maven/redirect?r=releases&g=io.brooklyn.example&a=brooklyn-example-simple-web-cluster&v=0.7.0-SNAPSHOT&e=jar - https://oss.sonatype.org/service/local/artifact/maven/redirect?r=releases&g=io.brooklyn.example&a=brooklyn-example-global-web-fabric&v=0.7.0-SNAPSHOT&e=jar - - - - - http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-large.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-large.png b/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-large.png deleted file mode 100644 index b566b1a..0000000 Binary files a/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-large.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-location-large.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-location-large.png b/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-location-large.png deleted file mode 100644 index 05e9b0c..0000000 Binary files a/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-location-large.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-location.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-location.png b/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-location.png deleted file mode 100644 index c13fdd8..0000000 Binary files a/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db-location.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db.png b/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db.png deleted file mode 100644 index ebb6f42..0000000 Binary files a/docs/website/quickstart/images/add-application-catalog-web-cluster-with-db.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/add-application-modal-yaml.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/add-application-modal-yaml.png b/docs/website/quickstart/images/add-application-modal-yaml.png deleted file mode 100644 index c50b7ab..0000000 Binary files a/docs/website/quickstart/images/add-application-modal-yaml.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/jboss7-cluster-policies-large.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/jboss7-cluster-policies-large.png b/docs/website/quickstart/images/jboss7-cluster-policies-large.png deleted file mode 100644 index 3d84477..0000000 Binary files a/docs/website/quickstart/images/jboss7-cluster-policies-large.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/jboss7-cluster-policies.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/jboss7-cluster-policies.png b/docs/website/quickstart/images/jboss7-cluster-policies.png deleted file mode 100644 index 2f85328..0000000 Binary files a/docs/website/quickstart/images/jboss7-cluster-policies.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/my-db-activities-large.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/my-db-activities-large.png b/docs/website/quickstart/images/my-db-activities-large.png deleted file mode 100644 index c214d9e..0000000 Binary files a/docs/website/quickstart/images/my-db-activities-large.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/my-db-activities.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/my-db-activities.png b/docs/website/quickstart/images/my-db-activities.png deleted file mode 100644 index 0f2327c..0000000 Binary files a/docs/website/quickstart/images/my-db-activities.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/my-web-cluster-starting.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/my-web-cluster-starting.png b/docs/website/quickstart/images/my-web-cluster-starting.png deleted file mode 100644 index c389b0b..0000000 Binary files a/docs/website/quickstart/images/my-web-cluster-starting.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/my-web-cluster-stop-confirm-large.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/my-web-cluster-stop-confirm-large.png b/docs/website/quickstart/images/my-web-cluster-stop-confirm-large.png deleted file mode 100644 index c9bdab6..0000000 Binary files a/docs/website/quickstart/images/my-web-cluster-stop-confirm-large.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/my-web-cluster-stop-confirm.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/my-web-cluster-stop-confirm.png b/docs/website/quickstart/images/my-web-cluster-stop-confirm.png deleted file mode 100644 index 179b00a..0000000 Binary files a/docs/website/quickstart/images/my-web-cluster-stop-confirm.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/my-web-summary-large.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/my-web-summary-large.png b/docs/website/quickstart/images/my-web-summary-large.png deleted file mode 100644 index fc4bffe..0000000 Binary files a/docs/website/quickstart/images/my-web-summary-large.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/my-web-summary.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/my-web-summary.png b/docs/website/quickstart/images/my-web-summary.png deleted file mode 100644 index e85752f..0000000 Binary files a/docs/website/quickstart/images/my-web-summary.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/images/my-web.png ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/images/my-web.png b/docs/website/quickstart/images/my-web.png deleted file mode 100644 index 2bd6ac3..0000000 Binary files a/docs/website/quickstart/images/my-web.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/index.md ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/index.md b/docs/website/quickstart/index.md deleted file mode 100644 index bc1215e..0000000 --- a/docs/website/quickstart/index.md +++ /dev/null @@ -1,218 +0,0 @@ ---- -title: Getting Started -layout: website-normal -children: -- { path: policies-and-catalogs.md } ---- - -{% include fields.md %} - -This guide will walk you through deploying an application to a public cloud. - -We will be deploying an example 3-tier web application, described using this blueprint: - -{% highlight yaml %} -{% readj _my-web-cluster.yaml %} -{% endhighlight %} - -(This is written in YAML, following the [camp specification](https://www.oasis-open.org/committees/camp/). ) - -This tutorial assumes that you are using Linux or Mac OSX. - - -## Verify SSH - -Brooklyn uses SSH extensively and therefore it is worth making sure that you have a known working SSH setup before -starting. - -Please check the following items: - -- If you are using Mac OSX, open System Preferences, go to the Sharing item, and enable 'Remote Login'. -- You have two files named `~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub`. - - If these files do not exist, they can be created with `ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa`. -- `~/.ssh/id_rsa` is NOT readable by any other user. - - You can verify this with `ls -l ~/.ssh/id_rsa` - the line should start with `-rw-------` or `-r--------`. If it - does not, execute `chmod 0600 ~/.ssh/id_rsa`. -- The file `~/.ssh/authorized_keys` exists and contains a copy of your public key from `~/.ssh/id_rsa.pub`. - - Note that it is normal for it to contain other items as well. -- The key in `~/.ssh/id_rsa` does *not* have a passphrase. - - You can test this by executing `ssh-keygen -y`. If it does *not* ask for a passphrase, then your key is OK. - - If your key does have a passphrase, remove it. You can do this by running `ssh-keygen -p`. Enter the passphrase, - then when prompted for the new passphrase, hit Enter. - -Now verify your setup by running the command: `ssh localhost echo hello world` - -If you see a message similar to this: - -
-The authenticity of host 'localhost (::1)' can't be established.
-RSA key fingerprint is 7b:e3:8e:c6:5b:2a:05:a1:7c:8a:cf:d1:6a:83:c2:ad.
-Are you sure you want to continue connecting (yes/no)?
-
- -then answer 'yes', and then repeat the command run again. - -If the response is `hello world`, with no other output or prompts, then your SSH setup is good and Brooklyn should be -able to use it without a problem. - -If these steps are not working, [these instructions]({{ site.path.guide }}/use/guide/locations/) may be -useful. - - -## Install Brooklyn - -Download Brooklyn and obtain a binary build as described on [the download page]({{site.path.website}}/download.html). - -{% if brooklyn_version contains 'SNAPSHOT' %} -Expand the `tar.gz` archive (note: as this is a -SNAPSHOT version, your filename will be slightly different): -{% else %} -Expand the `tar.gz` archive: -{% endif %} - -{% if brooklyn_version contains 'SNAPSHOT' %} -{% highlight bash %} -$ tar -zxf brooklyn-dist-{{ site.data.brooklyn.version }}-timestamp-dist.tar.gz -{% endhighlight %} -{% else %} -{% highlight bash %} -$ tar -zxf brooklyn-{{ site.data.brooklyn.version }}-dist.tar.gz -{% endhighlight %} -{% endif %} - -This will create a `brooklyn-{{ site.data.brooklyn.version }}` folder. - -Note: You'll need a Java JRE or SDK installed (version 6 or later), as Brooklyn is Java under the covers. - -## Launch Brooklyn - -Let's setup some paths for easy commands. - -(Click the clipboard on these code snippets for easier c&p.) - -{% highlight bash %} -$ cd brooklyn-{{ site.data.brooklyn.version }} -$ BROOKLYN_DIR="$(pwd)" -$ export PATH=$PATH:$BROOKLYN_DIR/bin/ -{% endhighlight %} - -We can do a quick test drive by launching Brooklyn: - -{% highlight bash %} -$ brooklyn launch -{% endhighlight %} - -Brooklyn will output the address of the management interface: - - -`INFO Starting brooklyn web-console on loopback interface because no security config is set` - -`INFO Started Brooklyn console at http://127.0.0.1:8081/, running classpath://brooklyn.war and []` - -But before we really use Brooklyn, we need to setup some Locations. - -Stop Brooklyn with ctrl-c. - -## Configuring a Location - -Brooklyn deploys applications to Locations. - -Locations can be clouds, machines with fixed IPs or localhost (for testing). - -Brooklyn loads Location configuration from `~/.brooklyn/brooklyn.properties`. - -Create a `.brooklyn` folder in your home directory and download the template [brooklyn.properties]({{brooklyn_properties_url_path}}) to that folder. - -{% highlight bash %} -$ mkdir ~/.brooklyn -$ cd ~/.brooklyn -$ wget {{brooklyn_properties_url_live}} -{% endhighlight %} - -Open brooklyn.properties in a text editor and add your cloud credentials. - -Restart Brooklyn: - -{% highlight bash %} -$ brooklyn launch -{% endhighlight %} - -## Launching an Application - -There are several ways to deploy a YAML blueprint (including specifying the blueprint on the command line or submitting it via the REST API). - -For now, we will simply copy-and-paste the raw YAML blueprint into the web console. - -Open the web console ([127.0.0.1:8081](http://127.0.0.1:8081)). As Brooklyn is not currently managing any applications the 'Create Application' dialog opens automatically. Select the YAML tab. - -![Brooklyn web console, showing the YAML tab of the Add Application dialog.](images/add-application-modal-yaml.png) - - -### Chose your Cloud / Location - -Let's look again at our YAML blueprint: - -{% highlight yaml %} -{% readj _my-web-cluster.yaml %} -{% endhighlight %} - -Copy this document into the large text box on the YAML tab, labelled `Enter CAMP Plan YAML code here`. But *before* you -submit it, we need to make a modification. - -Find the line near the top of the blueprint that starts `location:`. Change the line to name a location. For example, -one of these lines: - -{% highlight yaml %} -location: aws-ec2:us-east-1 -location: rackspace-cloudservers-us:ORD -location: google-compute-engine:europe-west1-a -location: localhost -{% endhighlight %} - -**My Web Cluster Blueprint** - -With the modified YAML in the dialog, click 'Finish'. The dialog will close and Brooklyn will begin deploying your -application. Your application will be shown as 'Starting' on the web console's front page. - -![My Web Cluster is STARTING.](images/my-web-cluster-starting.png) - - -## Monitoring and Managing Applications - -Click on the application name, or open the Applications tab. - -We can explore the management hierarchy of the application, which will show us the entities it is composed of. - - * My Web Cluster (A `BasicApplication`) - * My DB (A `MySqlNode`) - * My Web (A `ControlledDynamicWebAppCluster`) - * Cluster of JBoss7 Servers (A `DynamicWebAppCluster`) - * NginxController (An `NginxController`) - - - -Clicking on the 'My Web' entity will show the Summary tab. Here we can see if the cluster is ready to serve and, when ready, grab the web address for the front of the loadbalancer. - -![Exploring My Web.](images/my-web.png) - - -The Activity tab allows us to drill down into what activities each entity is currently doing or has recently done. It is possible to drill down to all child tasks, and view the commands issued, and any errors or warnings that occured. - -Drill into the 'My DB' start operation. Working down through 'Start (processes)', then 'launch', we can discover the ssh command used including the stdin, stdout and stderr. - -[![My DB Activities.](images/my-db-activities.png)](images/my-db-activities-large.png) - - -## Stopping the Application - -To stop an application, select the application in the tree view (the top/root entity), click on the Effectors tab, and invoke the 'Stop' effector. This will cleanly shutdown all components in the application and return any cloud machines that were being used. - -[![My DB Activities.](images/my-web-cluster-stop-confirm.png)](images/my-web-cluster-stop-confirm-large.png) - - -### Next - -So far we have touched on Brooklyn's ability to *deploy* an application blueprint to a cloud provider, but this a very small part of Brooklyn's capabilities! - -Brooklyn's real power is in using Policies to automatically *manage* applications. There is also the (very useful) ability to store a catalog of application blueprints, ready to go. - -[Getting Started - Policies and Catalogs](policies-and-catalogs.html) http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4afc8590/docs/website/quickstart/policies-and-catalogs.md ---------------------------------------------------------------------- diff --git a/docs/website/quickstart/policies-and-catalogs.md b/docs/website/quickstart/policies-and-catalogs.md deleted file mode 100644 index 021c0cd..0000000 --- a/docs/website/quickstart/policies-and-catalogs.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: Policies and Catalogs -layout: website-normal ---- - -In the [previous step](index.html) we downloaded Brooklyn and used it to deploy an application to a cloud, but at its heart Brooklyn is a policy driven *management* plane. - -Here we will introduce Polices using a simple demo app, which we will load from a Service Catalog. - -We strongly advise that you complete [the first tutorial](index.html) before proceeding with this one, to make sure that -your machine is correctly configured to be able to run Brooklyn applications. Like the previous tutorial, we are also -assuming that you are running Linux or Mac OSX. - - -## Service Catalogs - -Download the template [catalog.xml](catalog.xml) to your `~/.brooklyn/` folder, and relaunch Brooklyn. - -{% highlight bash %} -$ cd ~/.brooklyn -$ wget {{site.url_root}}{{site.path.guide}}/use/guide/quickstart/catalog.xml - -$ brooklyn launch -{% endhighlight %} - -Now when we open the web console, two applications are displayed from the catalog. - -Select the 'Demo Web Cluster with DB' and click 'Next'. - -[![Viewing Catalog entries in Add Application dialog.](images/add-application-catalog-web-cluster-with-db.png)](add-application-catalog-web-cluster-with-db-large.png) - -Select the Location that Brooklyn should deploy to, and name your application: - -[![Selecting a location and application name.](images/add-application-catalog-web-cluster-with-db-location.png)](images/add-application-catalog-web-cluster-with-db-location-large.png) - -Click 'Finish' to launch the application as before. - - -### Exploring and Testing Policies - -The Demo Web Cluster with DB application is pre-configured with two polices. - -The app server cluster has an `AutoScalerPolicy`, and the loadbalancer has a `targets` policy. - -Use the Applications tab in the web console to drill down into the Policies section of the ControlledDynamicWebAppCluster's Cluster of JBoss7Servers. - -You will see that the `AutoScalerPolicy` is running. - -[![Inspecting the jboss7 cluster policies.](images/jboss7-cluster-policies.png)](images/jboss7-cluster-policies-large.png) - - -This policy automatically scales the cluster up or down to be the right size for the cluster's current load. (One server is the minimum size allowed by the policy.) - -The loadbalancer's `targets` policy ensures that the loadbalancer is updated as the cluster size changes. - -Sitting idle, this cluster will only contain one server, but you can use a tool like [jmeter](http://jmeter.apache.org/) pointed at the nginx endpoint to create load on the cluster. (Download a [jmeter test plan](https://github.com/apache/incubator-brooklyn/blob/master/examples/simple-web-cluster/resources/jmeter-test-plan.jmx).) - -As load is added, Brooklyn requests a new cloud machine, creates a new app server, and adds it to the cluster. As load is removed, servers are removed from the cluster, and the infrastructure is handed back to the cloud. - -### Next - -The [Elastic Web Cluster Example]({{site.path.guide}}/use/examples/webcluster/index.html) page -details how to build this demo application from scratch in Java. It shows in more detail how Brooklyn can -complement your application with policy driven management, and how applications can be -run from the command line. - -