brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [02/10] incubator-brooklyn git commit: Policy updates.
Date Tue, 05 Jan 2016 11:16:24 GMT
Policy updates.


Branch: refs/heads/master
Commit: 5262d476090bc6d1575278ab225999629b8ce294
Parents: 36e2f14
Author: Geoff Macartney <>
Authored: Thu Dec 17 17:27:12 2015 +0000
Committer: Geoff Macartney <>
Committed: Wed Dec 23 12:24:56 2015 +0000

 docs/guide/start/ |  6 +++
 docs/guide/start/ | 91 +++++++++++++++++++++++------------
 2 files changed, 67 insertions(+), 30 deletions(-)
diff --git a/docs/guide/start/ b/docs/guide/start/
index 721c2c9..fba463c 100644
--- a/docs/guide/start/
+++ b/docs/guide/start/
@@ -108,6 +108,12 @@ onbox.base.dir.resolved   true
 install.unique_label      TomcatServer_7.0.65   
 {% endhighlight %}
+If an entity name is annoyingly long to type, the entity can be renamed:
+{% highlight bash %}
+$ br app Tomcat entity TomcatServer:Wx7r rename server
+{% endhighlight %}
 ## Sensors
 "Sensors" on entities provide a real-time picture of the status and operation of an entity
of the application.
diff --git a/docs/guide/start/ b/docs/guide/start/
index 2839bba..d5f1df4 100644
--- a/docs/guide/start/
+++ b/docs/guide/start/
@@ -24,11 +24,14 @@ You will need at least five machines for this example, one for the DB,
and four
 (but you can reduce this by changing the "maxPoolSize" below.
 {% highlight yaml %}
-name: java-cluster-db-policy-example
+name: cluster
+  tbd
 - serviceType: brooklyn.entity.webapp.ControlledDynamicWebAppCluster
-  name: My Web with Policy
-  location: localhost
+  name: webcluster
     http.port: 9280+
@@ -47,14 +50,13 @@ services:
 - serviceType: brooklyn.entity.database.mysql.MySqlNode
   id: db
-  name: My DB
+  name: mysql
   location: localhost
-    # this also uses the flag rather than the config key
 {% endhighlight %}
-Explore this app using the 'bk list application' and other commands from the previous section.
+Explore this app using the 'application' and other commands from the previous section.
 ## Configuring Dependencies
 The App above illustrates how one component in a blueprint can be configured with information
relating to one of the other 
@@ -73,8 +75,46 @@ allows expressions referring to Brooklyn's management information to be
 The app server cluster has an `AutoScalerPolicy`and the loadbalancer has a `Controller targets
tracker` policy.
-Use the Applications tab in the web console to drill down into the Policies section of the
-You will see that the `AutoScalerPolicy` is running.
+For example
+{% highlight yaml %}
+$ br app cluster ent webcluster policy
+Id         Name                                                      State   
+mMZngBnb   org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy   RUNNING   
+{% endhighlight %}
+You can investigate the status of the `AutoScalerPolicy` with 
+{% highlight yaml %}
+$ br app cluster ent webcluster policy org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
+{% endhighlight %}
+A more detailed description of the parameters of the policy can be obtained with
+{% highlight yaml %}
+$ br app cluster ent webcluster policy org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
+Name                                      Value                                         
+autoscaler.currentSizeOperator            org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy$4@9393100
                      The Entity with the metric that will be monitored   
+autoscaler.maxPoolSize                    4                                             
+autoscaler.maxReachedNotificationDelay    0ms                                           
                      Time that we consistently wanted to go above the maxPoolSize for, after
which the maxSizeReachedSensor (if any) will be emitted   
                      Sensor for which a notification will be emitted (on the associated entity)
when we consistently wanted to resize the pool above the max allowed size, for maxReachedNotificationDelay
+autoscaler.metric                         Sensor: webapp.reqs.perSec.windowed.perNode (java.lang.Double)
+autoscaler.metricLowerBound               10                                            
                      The lower bound of the monitored metric. Below this the policy will
resize down   
+autoscaler.metricUpperBound               100                                           
                      The upper bound of the monitored metric. Above this the policy will
resize up   
+autoscaler.minPeriodBetweenExecs          100ms                                         
+autoscaler.minPoolSize                    1                                             
+autoscaler.poolColdSensor                 Sensor: resizablepool.cold (java.util.Map)    
+autoscaler.poolHotSensor                  Sensor: (java.util.Map)     
+autoscaler.poolOkSensor                   Sensor: resizablepool.cold (java.util.Map)    
+autoscaler.resizeDownIterationIncrement   1                                             
                      Batch size for resizing down; the size will be decreased by a multiple
of this value   
+autoscaler.resizeDownIterationMax         2147483647                                    
                      Maximum change to the size on a single iteration when scaling down 
+autoscaler.resizeDownStabilizationDelay   0ms                                           
+autoscaler.resizeOperator                 org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy$3@387a7e10
+autoscaler.resizeUpIterationIncrement     1                                             
                      Batch size for resizing up; the size will be increased by a multiple
of this value   
+autoscaler.resizeUpIterationMax           2147483647                                    
                      Maximum change to the size on a single iteration when scaling up   
+autoscaler.resizeUpStabilizationDelay     0ms                                           
+{% endhighlight %}
 The loadbalancer's `Controller targets tracker` policy ensures that the loadbalancer is updated
as the cluster size changes.
@@ -88,22 +128,6 @@ plan [here](
 As load is added, Apache 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.
-{% highlight bash %}
-$ br list application
-Id         Name                             Status    Location   
-AQT22sAj   java-cluster-db-policy-example   RUNNING   koWi1cvr   
-$ br list entities AQT22sAj
-Id         Name                 Type   
-JT5eTIc5   My Web with Policy   org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
-cyXBexRx   My DB                org.apache.brooklyn.entity.database.mysql.MySqlNode   
-$ br show entity AQT22sAj JT5eTIc5
-Id         Name                                                                         
-dAaReeKJ   Cluster of TomcatServer (FixedListMachineProvisioningLocation{id=koWi1cvr, name=FixedListMachineProvisioningLocation:koWi})
-z6oxo0pC   NginxController:z6ox                                                         
-$ br list policies AQT22sAj z6oxo0pC
-Name                         State   
-Controller targets tracker   RUNNING   
-{% endhighlight %}
 ## Under the Covers
@@ -111,25 +135,32 @@ The `AutoScalerPolicy` here is configured to respond to the sensor
 reporting requests per second per node, invoking the default `resize` effector.
 By updating on the policy, you can configure it to respond to a much lower threshhold
 or set long stabilization delays (the period before it scales out or back).
-{% highlight bash %}
-TODO: example of command to update a policy
-{% endhighlight %}
-An even simpler test is to manually suspend the policy, by invoking "Suspend" on it.
+At present the CLI does not support a command to update a policy.
+However it is possible to manually suspend the policy, by 
 {% highlight bash %}
-TODO design this command
+$ br app cluster ent webcluster stop-policy org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
 {% endhighlight %}
 You can then invoke a `resize` using the appropriate effector:
 {% highlight bash %}
+$ br app cluster ent webcluster effector resize invoke -P desiredSize=3
 {% endhighlight %}
 On resize, new nodes are created and configured, 
 and in this case a policy on the nginx node reconfigures nginx whenever the set of active
 targets changes.
+The policy can then be re-enabled with start-policy:
+{% highlight bash %}
+$ br app cluster ent webcluster start-policy org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
+{% endhighlight %}
 ## Next

View raw message