Running Apache Brooklyn
This guide will walk you through deploying an example 3-tier web application to a public cloud, and demonstrate the autoscaling capabilities of the Brooklyn platform.
An overview of core Brooklyn concepts is available for reference.
Two methods of deployment are detailed in this tutorial, using virtualisation with Vagrant and a local install. Both assume that you are using Linux or Mac OS X.
Install Apache Brooklyn
Vagrant is a software package which automates the process of setting up virtual machines (VM) such as Oracle VirtualBox. We recommend it as the easiest way of getting started with Apache Brooklyn.
Firstly, download and install:
Then download the provided Apache Brooklyn vagrant configuration from here. This archive contains everything you need to create an environment for use with this guide, providing an Apache Brooklyn instance and some blank VMs.
Extract the tar.gz
archive and navigate into the expanded apache-brooklyn-0.9.0-SNAPSHOT-vagrant
folder
$ tar xvf apache-brooklyn-0.9.0-SNAPSHOT-vagrant.tar.gz
$ cd apache-brooklyn-0.9.0-SNAPSHOT-vagrant
Download the Apache Brooklyn binary distribution as described on the download page.
Extract the tar.gz
archive and navigate into the expanded apache-brooklyn-0.9.0-SNAPSHOT
folder.
$ tar -zxf apache-brooklyn-0.9.0-SNAPSHOT-dist.tar.gz
$ cd apache-brooklyn-0.9.0-SNAPSHOT
Note: You’ll need a Java Runtime Environment (JRE) installed (version 7 or later), as Brooklyn is Java under the covers.
It is not necessary at this time, but depending on what you are going to do, you may wish to set up other configuration options first:
Launch Apache Brooklyn
Now start Apache Brooklyn with the following command:
$ vagrant up brooklyn
You can see if Apache Brooklyn launched OK by viewing the log files with the command
$ vagrant ssh brooklyn --command 'sudo journalctl -n15 -f -u brooklyn'
Now start Apache Brooklyn with the following command:
$ bin/brooklyn launch
The application should then output it’s log into the console
Control Apache Brooklyn
Apache Brooklyn has a web console which can be used to control the application. The Brooklyn log will contain the address of the management interface:
INFO Started Brooklyn console at http://127.0.0.1:8081/, running classpath://brooklyn.war
By default it can be accessed by opening 127.0.0.1:8081 in your web browser.
The rest of this getting started guide uses the Apache Brooklyn command line interface (CLI). To use this, download and install the tool as described on the CLI GitHub page.
The CLI provides the command br
, it’s full usage is described in the user manual which can be found here
Next
The first thing we want to do with Brooklyn is deploy a blueprint.