Last active
January 29, 2016 05:36
-
-
Save murdoaird/19ed46588716bae588e1 to your computer and use it in GitHub Desktop.
Web Server and Riak Cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bash Web Server and Riak Cluster (Brooklyn Example) | |
# this example *references* the previous one, | |
# combining it with a stock blueprint for a Riak cluster, | |
# and shows how a sensor from the latter can be injected | |
services: | |
# reference template 2, overriding message to point at riak | |
- type: 2-bash-web-server-template | |
locations: [] | |
brooklyn.config: | |
my.message: $brooklyn:formatString("connected to Riak at %s", | |
$brooklyn:entity("riak-cluster").attributeWhenReady("main.uri")) | |
# use the off-the-shelf Riak cluster | |
- type: org.apache.brooklyn.entity.nosql.riak.RiakCluster | |
id: riak-cluster | |
initialSize: 2 | |
# and add a policy to scale based on ops per minute | |
brooklyn.policies: | |
- type: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy | |
brooklyn.config: | |
metric: riak.node.ops.1m.perNode | |
# more than 100 ops per second (6k/min) scales out, less than 50 scales back | |
# up to a max of 8 riak nodes here (can be changed in GUI / REST API afterwards) | |
metricLowerBound: 3000 | |
metricUpperBound: 6000 | |
minPoolSize: 1 | |
maxPoolSize: 3 | |
resizeUpStabilizationDelay: 30s | |
resizeDownStabilizationDelay: 5m | |
location: byon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The advertised URL is the internal IP address. Would require change to the "2-bash-web-server-template" catalog item