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 09BCC18091 for ; Mon, 1 Feb 2016 17:44:18 +0000 (UTC) Received: (qmail 15968 invoked by uid 500); 1 Feb 2016 17:44:02 -0000 Delivered-To: apmail-brooklyn-commits-archive@brooklyn.apache.org Received: (qmail 15798 invoked by uid 500); 1 Feb 2016 17:44:02 -0000 Mailing-List: contact commits-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list commits@brooklyn.apache.org Received: (qmail 15502 invoked by uid 99); 1 Feb 2016 17:44:01 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2016 17:44:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A0CE3DFE61; Mon, 1 Feb 2016 17:44:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: heneveld@apache.org To: commits@brooklyn.apache.org Date: Mon, 01 Feb 2016 17:44:09 -0000 Message-Id: <97b55b7486b14d6980c0e3eb37e3001a@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [09/50] brooklyn-docs git commit: Changes to Walkthrough text, update of images. Changes to Walkthrough text, update of images. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/458ae4d2 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/458ae4d2 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/458ae4d2 Branch: refs/heads/0.6.0 Commit: 458ae4d2947e4d3222308568cc1879303b499765 Parents: c75cadb Author: David Toy Authored: Fri Sep 27 11:14:33 2013 +0100 Committer: David Toy Committed: Fri Sep 27 11:14:33 2013 +0100 ---------------------------------------------------------------------- docs/start/walkthrough/index.md | 102 +++++++++++-------- .../walkthrough/walkthrough-webapp-w700.png | Bin 202434 -> 0 bytes docs/start/walkthrough/walkthrough-webapp.png | Bin 397368 -> 0 bytes .../walkthrough-webconsole-details-w700.png | Bin 161249 -> 0 bytes .../walkthrough-webconsole-details.png | Bin 335858 -> 0 bytes .../walkthrough-webconsole-map-w700.png | Bin 276162 -> 0 bytes .../walkthrough/walkthrough-webconsole-map.png | Bin 875310 -> 0 bytes .../walkthrough-webconsole-scaling-w700.png | Bin 222344 -> 0 bytes .../walkthrough-webconsole-scaling.png | Bin 428817 -> 0 bytes .../walkthrough/wt-deployed-application-700.png | Bin 0 -> 176494 bytes .../walkthrough/wt-deployed-application.png | Bin 0 -> 127347 bytes docs/start/walkthrough/wt-starting-700.png | Bin 0 -> 303892 bytes docs/start/walkthrough/wt-starting.png | Bin 0 -> 332710 bytes .../walkthrough/wt-tree-jboss-sensors-700.png | Bin 0 -> 268853 bytes .../start/walkthrough/wt-tree-jboss-sensors.png | Bin 0 -> 169929 bytes 15 files changed, 61 insertions(+), 41 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/index.md ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/index.md b/docs/start/walkthrough/index.md index 3b4d819..43c8391 100644 --- a/docs/start/walkthrough/index.md +++ b/docs/start/walkthrough/index.md @@ -7,36 +7,60 @@ toc: /toc.json ## Intro -Brooklyn makes it easy to describe how to launch and manage -sophisticated distributed applications. -Let's start with an example of a three tier application -composed of: +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 -A sample project can be created using the Brooklyn maven quickstart archetype: + +## Download the Sample Project + +Use Maven to download the Brooklyn quickstart archetype, and to setup the 'brooklyn-sample' directory and project. (Maven will automatically download Brooklyn and all dependencies.) + +{% if SNAPSHOT %} {% highlight bash %} export BROOKLYN_VERSION=0.6.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 + -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 cd brooklyn-sample {% endhighlight %} -{% if SNAPSHOT %} -For a snapshot version, you must either have a local `mvn install` of Brooklyn as described -[here]({{site.url}}/dev/code/index.html) or include the following additional `-D` define in -in the `mvn archetype:generate` command: +*Note*: As this is a snapshot version of Brooklyn, the code above includes a `-DarchetypeCatalog` specification. +This can be omitted for full versions, or if you already have a local `mvn install` of Brooklyn installed as described [here]({{site.url}}/dev/code/index.html). + +{% else %} {% highlight bash %} - -DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/archetype-catalog.xml +export BROOKLYN_VERSION=0.6.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 %} -An application blueprint can then be defined as a class as follows: +## Define your Application Blueprint + +An application blueprint is defined as a Java class, as follows: {% highlight java %} public class ClusterWebServerDatabaseSample extends AbstractApplication { @@ -48,33 +72,41 @@ public class ClusterWebServerDatabaseSample extends AbstractApplication { } {% endhighlight %} +`.../brooklyn-sample/src/main/java/com/acme/sample/brooklyn/sample/app/ClusterWebServerDatabaseSample.java` provides a template to follow. -## Runtime -To launch this application, simply build the project and run the `start.sh` script -in the resulting assembly: +## Deploying the Application + +If you have not already done so, follow the section in the [Getting Started Guide]({{site.url}}/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 application --class com.acme.sample.brooklyn.ClusterWebServerDatabaseSample \ + +./start.sh application \ + --class com.acme.sample.brooklyn.ClusterWebServerDatabaseSample \ --location jclouds:aws-ec2:eu-west-1 {% endhighlight %} -Amazon is used in these screenshots, but lots of targets are supported, +(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. -**It is necessary to set up credentials and/or access, as described [here]({{ site.url }}/use/guide/defining-applications/common-usage#locations).** +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](walkthrough-webconsole-map-w700.png "Web Console")](walkthrough-webconsole-map.png) +[![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](walkthrough-webconsole-details-w700.png "Web Console Details")](walkthrough-webconsole-details.png) +[![Web Console Details](wt-tree-jboss-sensors-700.png "Web Console Details")](wt-tree-jboss-sensors.png) ## Topology, Dependencies, and Management Policies @@ -92,6 +124,7 @@ 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. @@ -119,7 +152,7 @@ public class ClusterWebServerDatabaseSample extends AbstractApplication { We now see our app at the Nginx URL: -[![Our Web App](walkthrough-webapp-w700.png "Screenshot of our Web App")](walkthrough-webapp.png) +[![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. @@ -134,31 +167,18 @@ running management policies for applications whose topology it knows. 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, +*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 and blast the Nginx address. -The auto-scaler policy scales up our cluster: - -[![Web Cluster Scaling with the Auto-Scaler Policy](walkthrough-webconsole-scaling-w700.png "Screenshot of Web Cluster Scaling with the Resizer Policy")](walkthrough-webconsole-scaling.png) +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 -(and even the JMeter script) included with Brooklyn as the ``simple-web-cluster`` example, +`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.url}}/use/examples/webcluster). For your applications, you might want to mix in other data stores, messaging systems, or on-line services including PaaS. http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/walkthrough-webapp-w700.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/walkthrough-webapp-w700.png b/docs/start/walkthrough/walkthrough-webapp-w700.png deleted file mode 100644 index 2176b5a..0000000 Binary files a/docs/start/walkthrough/walkthrough-webapp-w700.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/walkthrough-webapp.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/walkthrough-webapp.png b/docs/start/walkthrough/walkthrough-webapp.png deleted file mode 100644 index c7cf264..0000000 Binary files a/docs/start/walkthrough/walkthrough-webapp.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/walkthrough-webconsole-details-w700.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/walkthrough-webconsole-details-w700.png b/docs/start/walkthrough/walkthrough-webconsole-details-w700.png deleted file mode 100644 index f11f353..0000000 Binary files a/docs/start/walkthrough/walkthrough-webconsole-details-w700.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/walkthrough-webconsole-details.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/walkthrough-webconsole-details.png b/docs/start/walkthrough/walkthrough-webconsole-details.png deleted file mode 100644 index e17a052..0000000 Binary files a/docs/start/walkthrough/walkthrough-webconsole-details.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/walkthrough-webconsole-map-w700.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/walkthrough-webconsole-map-w700.png b/docs/start/walkthrough/walkthrough-webconsole-map-w700.png deleted file mode 100644 index 6201387..0000000 Binary files a/docs/start/walkthrough/walkthrough-webconsole-map-w700.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/walkthrough-webconsole-map.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/walkthrough-webconsole-map.png b/docs/start/walkthrough/walkthrough-webconsole-map.png deleted file mode 100644 index 0a943f7..0000000 Binary files a/docs/start/walkthrough/walkthrough-webconsole-map.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/walkthrough-webconsole-scaling-w700.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/walkthrough-webconsole-scaling-w700.png b/docs/start/walkthrough/walkthrough-webconsole-scaling-w700.png deleted file mode 100644 index 871fdea..0000000 Binary files a/docs/start/walkthrough/walkthrough-webconsole-scaling-w700.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/walkthrough-webconsole-scaling.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/walkthrough-webconsole-scaling.png b/docs/start/walkthrough/walkthrough-webconsole-scaling.png deleted file mode 100644 index 47988cd..0000000 Binary files a/docs/start/walkthrough/walkthrough-webconsole-scaling.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/wt-deployed-application-700.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/wt-deployed-application-700.png b/docs/start/walkthrough/wt-deployed-application-700.png new file mode 100644 index 0000000..7ef90d9 Binary files /dev/null and b/docs/start/walkthrough/wt-deployed-application-700.png differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/wt-deployed-application.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/wt-deployed-application.png b/docs/start/walkthrough/wt-deployed-application.png new file mode 100644 index 0000000..751402e Binary files /dev/null and b/docs/start/walkthrough/wt-deployed-application.png differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/wt-starting-700.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/wt-starting-700.png b/docs/start/walkthrough/wt-starting-700.png new file mode 100644 index 0000000..c87a539 Binary files /dev/null and b/docs/start/walkthrough/wt-starting-700.png differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/wt-starting.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/wt-starting.png b/docs/start/walkthrough/wt-starting.png new file mode 100644 index 0000000..970805f Binary files /dev/null and b/docs/start/walkthrough/wt-starting.png differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/wt-tree-jboss-sensors-700.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/wt-tree-jboss-sensors-700.png b/docs/start/walkthrough/wt-tree-jboss-sensors-700.png new file mode 100644 index 0000000..3dfc7f2 Binary files /dev/null and b/docs/start/walkthrough/wt-tree-jboss-sensors-700.png differ http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/458ae4d2/docs/start/walkthrough/wt-tree-jboss-sensors.png ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/wt-tree-jboss-sensors.png b/docs/start/walkthrough/wt-tree-jboss-sensors.png new file mode 100644 index 0000000..4c44ea9 Binary files /dev/null and b/docs/start/walkthrough/wt-tree-jboss-sensors.png differ