Skip to content

Instantly share code, notes, and snippets.

@murdoaird
murdoaird / boot2docker error
Created March 19, 2014 15:34
To solve boot2docker error 'kernel panic'
VBoxManage setextradata boot2docker VBoxInternal/CPUM/EnableHVP 1
@murdoaird
murdoaird / additional_hw.yaml
Created December 20, 2015 21:46
Additional HW
name: My Web Cluster
location:
byon:
user: vagrant
password: vagrant
hosts:
- 10.10.10.101
- 10.10.10.102
- 10.10.10.103
@murdoaird
murdoaird / Python Web Server.yaml
Last active September 13, 2016 14:03
Python Web Server
name: Python Web Server
# this example deploys a very simple python web server
services:
- type: vanilla-bash-server
name: My Bash Web Server VM
brooklyn.config:
install.command: |
# install python if not present
@murdoaird
murdoaird / gist:516e3a0480057a778c7f
Created December 29, 2015 11:45
Add named Location
brooklyn.location.named.local-vagrant = byon:(hosts="10.10.10.101,10.10.10.102,10.10.10.103,10.10.10.104")
brooklyn.location.named.local-vagrant.user = vagrant
brooklyn.location.named.local-vagrant.password = vagrant
@murdoaird
murdoaird / catalog.yaml
Last active January 26, 2016 07:38
New Catalog Entity
brooklyn.catalog:
version: 1.0
id: my-sql
description: MySQL is a relational database.
item:
type: org.apache.brooklyn.entity.database.mysql.MySqlCluster
initialSize: 2
name: MySQL Node
location: byon
@murdoaird
murdoaird / Web Server and Riak Cluster.yaml
Last active January 29, 2016 05:36
Web Server and Riak Cluster
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
@murdoaird
murdoaird / Basic Enrichers.yaml
Last active January 27, 2016 11:53
Basic Enrichers
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
@murdoaird
murdoaird / Resilient Load-Balanced Bash Web Cluster.yaml
Last active January 22, 2016 20:29
Resilient Load-Balanced Bash Web Cluster
name: Resilient Load-Balanced Bash Web Cluster (Brooklyn Example)
# this final example shows some of the advanced functionality:
# defining custom sensors, and a cluster with a "spec",
# policies for resilience and scaling based on that sensor,
# and wiring a load balancer in front of the cluster
# combining this with the riak cluster in the previous example
# is left as a suggested exercise for the user
@murdoaird
murdoaird / brooklyn.properties
Created January 7, 2016 09:39
brooklyn.properties
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@murdoaird
murdoaird / CratePolicy.java
Last active February 19, 2016 19:10 — forked from nakomis/CratePolicy.java
Crate Policy
package com.acme.crate;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.brooklyn.api.entity.EntityLocal;
import org.apache.brooklyn.api.sensor.SensorEvent;
import org.apache.brooklyn.api.sensor.SensorEventListener;
import org.apache.brooklyn.core.entity.trait.Startable;
import org.apache.brooklyn.core.mgmt.internal.EffectorUtils;