you to specify arbitrary shell script for the install, customise and launch phases • Allows you to make an en?ty out of anything that can be shell scripted name: Jenkins location: jclouds:digitalocean services: - name: Jenkins type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess provisioning.properties: osFamily: ubuntu minRam: 2048 brooklyn.config: jenkins.port: 8080 shell.env: jport: $brooklyn:config("jenkins.port") install.command: | wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo a sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/a sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthe sudo service jenkins stop customize.command: sudo sed -i.bak 's/^HTTP_PORT=.*$/HTTP_PORT='$jport'/ launch.command: sudo service jenkins start checkRunning.command: sudo service jenkins status
of sensors and effectors • These can come from SSH shell script commands, HTTP queries, and more • Not just limited to VanillaSoYwareProcess -‐ can be applied to any en?ty! brooklyn.initializers: - type: org.apache.brooklyn.core.sensor.StaticSensor brooklyn.config: name: jenkins.port static.value: $brooklyn:config("jenkins.port") brooklyn.enrichers: - enricherType: org.apache.brooklyn.enricher.stock.Transformer brooklyn.config: enricher.producer: $brooklyn:component("this" ,"") enricher.sourceSensor: $brooklyn:sensor("host.name") enricher.targetSensor: $brooklyn:sensor("jenkins.url") enricher.targetValue: $brooklyn:formatString("http://%s:%s/", $brook
URLs for all the cookbooks, specify a run list and aDributes • Chef Server supported too! • …and we can fit exactly the same en?ty ini?alisers we used for the shell-‐based blueprint! name: Jenkins via Chef location: jclouds:digitalocean services: - type: chef:jenkins brooklyn.config: jenkins.port: 8090 cookbook_urls: jenkins: https://supermarket.chef.io/cookbooks/jenkins/download java: https://github.com/agileorbit-cookbooks/java/archive/v1.29.0.tar apt: https://supermarket.chef.io/cookbooks/apt/download runit: https://supermarket.chef.io/cookbooks/runit/download packagecloud: https://supermarket.chef.io/cookbooks/packagecloud/downl yum: https://supermarket.chef.io/cookbooks/yum/download launch_run_list: [ "jenkins::master" ] service_name: jenkins launch_attributes: jenkins: master: port: $brooklyn:config("jenkins.port") java: jdk_version: 7
work with a loca?on of localhost • During development, deploy your en??es (e.g. database and web app container) to localhost for fast turnaround and no cloud fees • Or, use VirtualBox to fire up a number of ready-‐to-‐go VMs, and use the byon loca?on • Give your en??es the IP addresses of the VMs you pre-‐created • Or, use the experimental Vagrant plugin to deploy VirtualBox VMs on demand
HQ nego?ated a beDer deal with a different cloud provider? • Just change the loca?on to the new cloud provider • Deploy the blueprint and it will s?ll work first ?me! • Probably
don’t have to be soYware on a virtual machine! • Use Brooklyn to interact with things which have an API • Effectors use the API to do something • Sensors use the API to gather data • then apply Policies to make things happen automa?cally
with the Apache Cloudstack API • Allows crea?on of private subnets for a Brooklyn applica?on • En??es in the applica?on share a private network • Selected public ports are configured for port forwarding at the gateway
is using Brooklyn to orchestrate fibre op?c networks across data centres • Telco-‐grade ($$$$$) op?cal networking hardware and routers • A “bridge” app receives a customer’s order from the business systems and turns it into a Brooklyn blueprint describing a mul?-‐site op?cal network • Brooklyn configures the networking hardware to realise the customer’s order • But I can’t talk about it because of an NDA :-‐(
original purpose of Brooklyn! • Take an app that expects infrastructure to be already arranged… • Brooklyn arranges the infrastructure in the cloud of your choice • Then deploys the app and configures it with the details of the infrastructure
to make it easy to provision, manage and monitor Apache Hadoop clusters. • …but it expects hardware/VMs to be already available. • Combine it with Brooklyn: • Brooklyn creates the VMs, installs Ambari, configures it with the details of the VMs, and starts Ambari provisioning Hadoop • From zero to Hadoop cluster in the cloud, with one blueprint!
• Brooklyn en??es, policies and loca?ons to manage Docker Engines, the Containers on them, and networking between them • Create a Docker infrastructure consis?ng of a number of engines on your favourite cloud • Take your exis?ng Brooklyn blueprints and change the loca?on -‐ now they are deploying to Docker containers! • Integrates with Calico and Weave for seamless networking between containers
• Many presenta?ons and videos, including: • Video: “How to Create a Docker Cloud with Brooklyn, jclouds and Clocker” presented by Andrea Turli at ApacheCon North America 2015 https://youtu.be/oBEwFpYD620 • Slide deck: “Using Clocker with Project Calico -‐ Running Produc?on Workloads in the Cloud” presented by Andrew Kennedy at SoYware Circus 2015 https://speakerdeck.com/grkvlt/using-clocker-with-project-calico-running- production-workloads-in-the-cloud • Full list at https://github.com/brooklyncentral/clocker/wiki/Talks-and-Presentations
to a persistent store • A file system loca?on, or • A blobstore • In the event of a crash, a new instance of Brooklyn can load the persisted state and “re-‐bind”
persistence • auto: rebind to state if it exists; clean startup if no saved state • rebind: rebind to state if it exists; error if no saved state • clean: remove any exis?ng state
to ~/.brooklyn, or container name when using blobstore. Defaults to brooklyn-persisted-state • Blobstore: • --persistenceLocation — reference to a blobstore • a jclouds public cloud provider -‐ e.g. jclouds:aws-s3 • a named loca?on defined in brooklyn.properties -‐ e.g. named:my-blobstore • creden?als best specified in brooklyn.properties
so that failures do not cause loss of service • Master-‐standby system • One Brooklyn instance is the master and is opera?ng normally • Other instances are hot standbys in a read-‐only mode • If the master fails, one of the standbys is promoted to master so that service can con?nue
-‐ all instances share the same persistent store • Master is the only instance that writes to the persistence store • Master writes “heartbeat” messages to the store • Standbys read the persisted state • If a standby detects that the master is no longer wri?ng heartbeats, it promotes itself to master
HA • auto: will start as master if there isn’t one; or as standby if there is already a master • master: will start as master; fails if there is already a master • standby: will start as standby; fails if there is no exis?ng master • hot_standby: as standby, and also rebinds to en??es read-‐only so Brooklyn’s state can be observed
A service provider offering Brooklyn services to mul?ple customers can start up a Brooklyn instance for each customer • No risk of customer data cross between instances
• Use it to bootstrap itself into a HA setup • Run Brooklyn on your worksta?on in HA mode • Use it to provision a Brooklyn HA cluster with the same persistent store • Shut down Brooklyn on your worksta?on • Brooklyn is now a self-‐managing, self-‐healing HA cluster
instance of PostgreSQL or MySQL • Uses admin login to create a new user • Publishes the new user details to sensors • (Op?onal) A second en?ty that forwards the normal user login and hides the admin user login name: Postgres Access services: - type: io.cloudsoft.dbaccess.PostgresDatabaseAccessEntity name: Postgres Access brooklyn.config: dbaccess.endpoint.url: postgresql://192.241.135.61:5432/ dbaccess.admin.user: superuser dbaccess.admin.password: Sup3r_S3kr1t dbaccess.database: db dbaccess.username: fred dbaccess.password: n0rm4l_u5er
need tes?ng. • Automated tests are a valuable tool in development • So if you are coding a Java blueprint… • Test your blueprint automa?cally as part of your build