Fix markup funnies causing rendering errors
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/04957337 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/04957337 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/04957337 Branch: refs/heads/master Commit: 04957337b01874b9e026dab17eba383ee2ec5871 Parents: 2161c93 Author: Richard Downer <[email protected]> Authored: Wed Oct 11 14:07:02 2017 +0100 Committer: Thomas Bouron <[email protected]> Committed: Mon Oct 16 14:56:04 2017 +0100 ---------------------------------------------------------------------- guide/start/blueprints.md | 8 +-- guide/start/managing.md | 123 +++++++++++------------------------------ guide/start/policies.md | 63 ++++++--------------- guide/start/running.md | 9 ++- 4 files changed, 58 insertions(+), 145 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/04957337/guide/start/blueprints.md ---------------------------------------------------------------------- diff --git a/guide/start/blueprints.md b/guide/start/blueprints.md index 91cad7f..fc05cd6 100644 --- a/guide/start/blueprints.md +++ b/guide/start/blueprints.md @@ -94,7 +94,7 @@ location: ## Deploying the Application First, log in to brooklyn with the command line interface (CLI) tool by typing: -```bash +``` $ br login http://localhost:8081/ ``` @@ -103,14 +103,12 @@ If this is configured, the login command will require an additional parameter fo Now you can create the application with the command below: -```bash -$ br deploy myapp.yaml ``` -<pre> +$ br deploy myapp.yaml Id: hTPAF19s Name: Tomcat Status: In progress -</pre> +``` Depending on your choice of location it may take some time for the application to start, the next page describes how you can monitor the progress of the application deployment and verify if it was successful. http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/04957337/guide/start/managing.md ---------------------------------------------------------------------- diff --git a/guide/start/managing.md b/guide/start/managing.md index 619fe2e..148a14d 100644 --- a/guide/start/managing.md +++ b/guide/start/managing.md @@ -20,21 +20,16 @@ the beginning. Next we will outline how to *manage* the application that has bee ## Applications Having created the application, we can find a summary of all deployed applications using: -```bash -$ br application ``` - -```bash +$ br application Id Name Status Location hTPAF19s Tomcat RUNNING ajVVAhER ``` -```application``` can be shortened to the alias ```app```, for example: -```bash -$ br app -``` +`application` can be shortened to the alias `app`, for example: -```bash +``` +$ br app Id Name Status Location hTPAF19s Tomcat RUNNING ajVVAhER ``` @@ -49,11 +44,8 @@ In the above example the Id `hTPAF19s` and the Name `Tomcat` are shown. You can Using the name `Tomcat` we can get the application details: -```bash -$ br application Tomcat ``` - -```bash +$ br application Tomcat Id: hTPAF19s Name: Tomcat Status: RUNNING @@ -70,11 +62,8 @@ $ br application Tomcat We can explore the management hierarchy of all applications, which will show us the entities they are composed of. -```bash -$ br tree ``` - -```text +$ br tree |- Tomcat +- org.apache.brooklyn.entity.stock.BasicApplication |- tomcatServer @@ -85,11 +74,8 @@ $ br tree You can view the blueprint for the application again: -```bash -$ br application Tomcat spec ``` - -```yaml +$ br application Tomcat spec name: Tomcat location: mylocation services: @@ -100,10 +86,8 @@ services: You can view the configuration of the application: -```bash -$ br application Tomcat config ``` -```bash +$ br application Tomcat config Key Value camp.template.id l67i25CM brooklyn.wrapper_app true @@ -115,10 +99,8 @@ An *Entity* is Apache Brooklyn's representation of a software package or service To list the entities of the application you can use the `entity` or `ent` command: -```bash -$ br application Tomcat entity ``` -```bash +$ br application Tomcat entity Id Name Type Wx7r1C4e tomcatServer org.apache.brooklyn.entity.webapp.tomcat.TomcatServer ``` @@ -127,11 +109,8 @@ This shows one entity is available: `tomcatServer`. Note that this is the name w You can get summary information for this entity by providing its name (or ID). -```bash -$ br application Tomcat entity tomcatServer ``` - -```bash +$ br application Tomcat entity tomcatServer Id: Wx7r1C4e Name: tomcatServer Status: RUNNING @@ -142,11 +121,8 @@ CatalogItemId: null Also you can see the configuration of this entity with the ```config``` command. -```bash -$ br application Tomcat entity tomcatServer config ``` - -```bash +$ br application Tomcat entity tomcatServer config Key Value jmx.agent.mode JMXMP_AND_RMI brooklyn.wrapper_app true @@ -162,11 +138,8 @@ install.unique_label TomcatServer_7.0.65 You can view the sensors available on the application using: -```bash -$ br application Tomcat sensor ``` - -```bash +$ br application Tomcat sensor Name Description Value service.isUp Whether the service is active and availability (confirmed and monitored) true service.notUp.indicators A map of namespaced indicators that the service is not up {} @@ -177,11 +150,8 @@ service.state.expected Last controlled change to service state, indicating w To explore sensors on a specific entity use the `sensor` command with an entity specified: -```bash -$ br application Tomcat entity tomcatServer sensor ``` - -```bash +$ br application Tomcat entity tomcatServer sensor Name Description Value download.addon.urls URL patterns for downloading named add-ons (will substitute things like ${version} automatically) download.url URL pattern for downloading the installer (will substitute things like ${version} automatically) "http://download.nextag.com/apache/tomcat/tomcat-7/v${version}/bin/apache-tomcat-${version}.tar.gz" @@ -197,23 +167,18 @@ host.subnet.hostname Host name as known internally in the subnet where it is run To display the value of a selected sensor, give the command the sensor name as an argument -```bash +``` $ br application Tomcat entity tomcatServer sensor webapp.url +"http://10.10.10.101:8080/" ``` -```text -http://10.10.10.101:8080/ -``` ## Effectors Effectors are a means by which you can manipulate the entities in an application. You can list the available effectors for your application using: -```bash -$ br application Tomcat effector ``` - -```bash +$ br application Tomcat effector Name Description Parameters restart Restart the process/service represented by an entity start Start the process/service represented by an entity locations @@ -225,11 +190,8 @@ Note that the three "lifecycle" related effectors, ```start```, ```stop```, and You can list the effectors for a specific entity using the command: -```bash -$ br application Tomcat entity tomcatServer effector ``` - -```bash +$ br application Tomcat entity tomcatServer effector Name Description Parameters deploy Deploys the given artifact, from a source URL, to a given deployment filename/context url,targetName populateServiceNotUpDiagnostics Populates the attribute service.notUp.diagnostics, with any available health indicators @@ -241,11 +203,8 @@ undeploy Undeploys the given context/artifact To view the details for a specific effector, append it's name to the command: -```bash -$ br application Tomcat entity tomcatServer effector deploy ``` - -```bash +$ br application Tomcat entity tomcatServer effector deploy Name Description Parameters deploy Deploys the given artifact, from a source URL, to a given deployment filename/context url,targetName ``` @@ -257,21 +216,18 @@ These parameters can be supplied using ```--param parm=value``` or just ```-P pa The commands below deploy the Apache Tomcat [hello world example](http://tomcat.apache.org/tomcat-6.0-doc/appdev/index.html) to our Tomcat Server. In these commands, a variable is created for the root URL using the appropriate sensor and the index page html is displayed. -```bash +``` $ br application Tomcat entity tomcatServer effector deploy invoke -P url=https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war -P targetName=sample $ webapp=$(br application Tomcat entity tomcatServer sensor webapp.url | tr -d '"') $ curl $webapp/sample/ + <html> + <head> + <title>Sample "Hello, World" Application</title> + </head> + ... ``` -```html -<html> -<head> -<title>Sample "Hello, World" Application</title> -</head> -... -``` - -**Note** that at present a ```tr``` command is required in the second line below to strip quotation characters from the returned sensor value. +**Note** that at present a `tr` command is required in the second line below to strip quotation characters from the returned sensor value. ## Activities @@ -279,11 +235,8 @@ $ curl $webapp/sample/ To view a list of all activities associated with an entity enter: -```bash -$ br application Tomcat entity tomcatServer activity ``` - -```bash +$ br application Tomcat entity tomcatServer activity Id Task Submitted Status Streams LtD5P1cb start Thu Dec 17 15:04:43 GMT 2015 Completed l2qo4vTl provisioning (FixedListMachineProvisi... Thu Dec 17 15:04:43 GMT 2015 Completed @@ -295,11 +248,8 @@ jwwcJWmF start (processes) Thu Dec 17 15:04:43 GMT 20 To view the details of an individual activity, add its ID to the command. In our case this is `jwwcJWmF` -```bash -$ br application Tomcat entity tomcatServer activity jwwcJWmF ``` - -```bash +$ br application Tomcat entity tomcatServer activity jwwcJWmF Id: jwwcJWmF DisplayName: start (processes) Description: @@ -326,11 +276,8 @@ If an activity has associated input and output streams, these may be viewed by p using the commands, "env", "stdin", "stdout", and "stderr". For example, for the "initializing on-box base dir" activity from the result of the earlier example, -```bash +``` $ br application Tomcat entity tomcatServer act KLTxDkoa stdout -``` - -```bash BASE_DIR_RESULT:/home/vagrant/brooklyn-managed-processes:BASE_DIR_RESULT ``` @@ -355,11 +302,8 @@ $ br application Tomcat entity tomcatServer act KLTxDkoa stderr If an activity has failed, the "DetailedStatus" value will help us diagnose what went wrong by showing information about the failure. -```bash -$ br application evHUlq0n entity tomcatServer activity lZZ9x662 ``` - -```bash +$ br application evHUlq0n entity tomcatServer activity lZZ9x662 Id: lZZ9x662 DisplayName: post-start Description: @@ -392,11 +336,8 @@ java.lang.IllegalStateException: Software process entity TomcatServerImpl{id=qZe Adding the "--children" or "-c" parameter will show the activity's child activities, to allow the hierarchical structure of the activities to be investigated: -```bash -$ br application Tomcat entity tomcatServer activity -c jwwcJWmF ``` - -```bash +$ br application Tomcat entity tomcatServer activity -c jwwcJWmF Id Task Submitted Status UpYRc3fw copy-pre-install-resources Thu Dec 17 15:04:43 GMT 2015 Completed ig8sBHQr pre-install Thu Dec 17 15:04:43 GMT 2015 Completed @@ -434,7 +375,9 @@ $ br application Tomcat entity tomcatServer config ``` runs the ```config``` command with application scope of ```Tomcat``` and entity scope of ```tomcatServer```. +{% if output.name == 'website' %} ## Next We will look next at a slightly more complex example, which will illustrate the capabilities of Brooklyn's -**[policies](policies.md)** mechanism, and how to configure dependencies between application entities. \ No newline at end of file +**[policies](policies.md)** mechanism, and how to configure dependencies between application entities. +{% endif %} http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/04957337/guide/start/policies.md ---------------------------------------------------------------------- diff --git a/guide/start/policies.md b/guide/start/policies.md index 84b20ba..2f2718a 100644 --- a/guide/start/policies.md +++ b/guide/start/policies.md @@ -285,40 +285,31 @@ in the cluster. In our example, each is a Tomcat server with a WAR deployed at t Deploy the app: -```bash -br deploy mycluster.yaml ``` - -<pre> +$ br deploy mycluster.yaml Id: nGY58ZZN Name: Tomcat Cluster Status: In progress -</pre> +``` And wait for the app to be running, viewing its state with: -```bash -br application ``` - -<pre> +$ br application Id Name Status Location nGY58ZZN Tomcat Cluster RUNNING Mf0CJac6 -</pre> +``` You can view the list of entities within the cluster with the command below (which drills into the application named "Tomcat Cluster", then into its child entity named "Cluster", and then lists its entities): -```bash -br application "Tomcat Cluster" entity "Cluster" entity ``` - -<pre> +$ br application "Tomcat Cluster" entity "Cluster" entity Id Name Type dYfUvLIw quarantine org.apache.brooklyn.entity.group.QuarantineGroup tOpMeYYr Tomcat Server org.apache.brooklyn.entity.webapp.tomcat.TomcatServer -</pre> +``` The "quarantine" entity is used when Tomcat servers fail to start correctly - this entity is by default added to the quarantine group, where it can later be investigated. This can be disabled using @@ -360,18 +351,15 @@ You can view the state of the Tomcat server with the command below (which drills application named "Tomcat Cluster", then into its child entity named "Cluster", and then into the first member of the cluster named "Tomcat Server"): -```bash -br application "Tomcat Cluster" entity "Cluster" entity "Tomcat Server" ``` - -<pre> +$ br application "Tomcat Cluster" entity "Cluster" entity "Tomcat Server" Id: tOpMeYYr Name: Tomcat Server Status: ON_FIRE ServiceUp: false Type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer CatalogItemId: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer:0.0.0.SNAPSHOT -</pre> +``` <!-- COMMENT: You can view its activity, to see the call to restart, using: @@ -401,16 +389,13 @@ You can view the list of Tomcat servers in the cluster with the command below (w application named "Tomcat Cluster", then into its child entity named "Cluster", and then lists the child entities): -```bash -br application "Tomcat Cluster" entity "Cluster" entity ``` - -<pre> +$ br application "Tomcat Cluster" entity "Cluster" entity Id Name Type dYfUvLIw quarantine org.apache.brooklyn.entity.group.QuarantineGroup tOpMeYYr Tomcat Server org.apache.brooklyn.entity.webapp.tomcat.TomcatServer mgoRpkKH Tomcat Server org.apache.brooklyn.entity.webapp.tomcat.TomcatServer -</pre> +``` ## Auto-scaling @@ -445,11 +430,8 @@ done While those curl commands run in a separate terminal, you can look at the metrics for the first Tomcat server using the command: -```bash -br application "Tomcat Cluster" entity "Cluster" entity "Tomcat Server" sensor ``` - -<pre> +$ br application "Tomcat Cluster" entity "Cluster" entity "Tomcat Server" sensor Name Description Value ... webapp.reqs.perSec.last Reqs/sec (last datapoint) 0.9980039920159681 @@ -462,42 +444,33 @@ br application "Tomcat Cluster" entity "Cluster" entity "Tomcat Server" sensor webapp.tomcat.connectorStatus Catalina connector state name "STARTED" webapp.url URL "http://10.10.10.103:18082/" ... -</pre> +``` You can look at the average requests per second on the cluster with the command: -```bash -br application "Tomcat Cluster" entity "Cluster" sensor "webapp.reqs.perSec.perNode" ``` - -<pre> +$ br application "Tomcat Cluster" entity "Cluster" sensor "webapp.reqs.perSec.perNode" 25.765557404326124 -</pre> +``` When this value exceeds 3 for two seconds, the cluster with scale up. You can see the new instance using the command: -```bash -br application "Tomcat Cluster" entity "Cluster" entity ``` - -<pre> +$ br application "Tomcat Cluster" entity "Cluster" entity Id Name Type dYfUvLIw quarantine org.apache.brooklyn.entity.group.QuarantineGroup mgoRpkKH Tomcat Server org.apache.brooklyn.entity.webapp.tomcat.TomcatServer xpLeJufy Tomcat Server org.apache.brooklyn.entity.webapp.tomcat.TomcatServer CpabLxZE Tomcat Server org.apache.brooklyn.entity.webapp.tomcat.TomcatServer -</pre> +``` Cancel the curl commands (or wait for them to finish), and then wait for the one minute `resizeDownStabilizationDelay`. The cluster will scale back to the minimum one instance. -```bash -br application "Tomcat Cluster" entity "Cluster" entity ``` - -<pre> +$ br application "Tomcat Cluster" entity "Cluster" entity Id Name Type dYfUvLIw quarantine org.apache.brooklyn.entity.group.QuarantineGroup mgoRpkKH Tomcat Server org.apache.brooklyn.entity.webapp.tomcat.TomcatServer -</pre> +``` http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/04957337/guide/start/running.md ---------------------------------------------------------------------- diff --git a/guide/start/running.md b/guide/start/running.md index 0039316..93c96ad 100644 --- a/guide/start/running.md +++ b/guide/start/running.md @@ -128,6 +128,10 @@ to configure security. Documentation of configuration options include: {% method -%} +{% common -%} +**Important**: Before launching Apache Brooklyn, please check the `date` on the local machine. +Even several minutes before or after the actual time could cause problems. + {% sample lang="vagrant" -%} ### Launching in Vagrant @@ -183,11 +187,6 @@ You can now start Apache Brooklyn by running `c:\Program Files\brooklyn\bin\star The application should then output its log into the console and also `c:\Program Files\brooklyn\data\log\brooklyn.debug.log` and `c:\Program Files\brooklyn\data\log\brooklyn.info.log` -</div> -_Notice! Before launching Apache Brooklyn, please check the `date` on the local machine. -Even several minutes before or after the actual time could cause problems._ -</div> - {% endmethod %} ## Control Apache Brooklyn
