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.
Two methods of deployment are detailed in this tutorial, using virtualisation with Vagrant and an install in your own environment (such as your local machine or in your private/public cloud).
The latter assumes that you have a Java Runtime Environment installed (version 7 or later), as Brooklyn is Java under the covers.
To get you up-and-running quickly, the Vagrant option will provision four compute nodes for you to deploy applications to.
{::options parse_block_html=“true” /}
a) Vagrant
Vagrant{:target=“_blank”} is a software package which automates the process of setting up virtual machines (VM) such as Oracle VirtualBox{:target=“_blank”}. 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 {% if site.brooklyn-version contains ‘SNAPSHOT’ %} here{:target=“_blank”}. {% else %} here{:target=“_blank”}. {% endif %} 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-{{site.brooklyn-version}}-vagrant
folder {% if site.brooklyn-version contains ‘SNAPSHOT’ %}(note: as this is a -SNAPSHOT version, your filename will be slightly different){% endif %}
{% highlight bash %} $ tar xvf apache-brooklyn-{{site.brooklyn-version}}-vagrant.tar.gz $ cd apache-brooklyn-{{site.brooklyn-version}}-vagrant {% endhighlight %}
b) Centos / RHEL 7
{% if site.brooklyn-version contains ‘SNAPSHOT’ %}Please note, an RPM is not available for snapshot builds{% endif %}
For Centos 7 and RHEL 7 users, the recommended way to install Apache Brooklyn on RPM-based Linux distributions is by using the RPM package.
RPM is the de facto standard for packaging software on these Linux distributions and provides a mechanism for installing, upgrading and removing packages such as Apache Brooklyn. The RPM package contains all the necessary files associated with the Apache Brooklyn application.
{% if site.brooklyn-version contains ‘SNAPSHOT’ %} This is a snapshot build and no RPM is available, please download a different version. {% else %} Download the Apache Brooklyn RPM distribution{:target=“_blank”}. {% endif %}
Once downloaded, run the following shell command as root:
{% highlight bash %} $ yum install apache-brooklyn-{{site.brooklyn-version}}-1.rpm {% endhighlight %}
c) Debian / Ubuntu
For Ubuntu and Debian users, the recommended way to install Apache Brooklyn is to use the deb file.
The deb file is the de facto standard for packaging software on these Linux distributions and provides a mechanism for installing, upgrading and removing packages such as Apache Brooklyn. The deb package contains all the necessary files associated with the Apache Brooklyn application.
{% if site.brooklyn-version contains ‘SNAPSHOT’ %} Download the Apache Brooklyn deb distribution{:target=“_blank”}. {% else %} Download the Apache Brooklyn deb distribution{:target=“_blank”}. {% endif %}
Once downloaded, run the following shell command:
{% highlight bash %} $ sudo dpkg -i apache-brooklyn_{{site.brooklyn-version}}_noarch.deb {% endhighlight %}
d) OSX / Linux
For Linux or OSX please download the Apache Brooklyn tar.gz
archive from the download{:target=“_blank”} section.
{% if site.brooklyn-version contains ‘SNAPSHOT’ %} Extract the tar.gz
archive (note: as this is a -SNAPSHOT version, your filename will be slightly different): {% else %} Extract the tar.gz
archive and navigate into the expanded apache-brooklyn-{{ site.brooklyn-version }}
folder. {% endif %}
{% if site.brooklyn-version contains ‘SNAPSHOT’ %} {% highlight bash %} $ tar -zxf apache-brooklyn-dist-{{ site.brooklyn-version }}-timestamp-dist.tar.gz $ cd apache-brooklyn-{{ site.brooklyn.version }} {% endhighlight %} {% else %} {% highlight bash %} $ tar -zxf apache-brooklyn-{{ site.brooklyn-version }}-dist.tar.gz $ cd apache-brooklyn-{{ site.brooklyn.version }} {% endhighlight %} {% endif %}
e) Windows
For all versions of Microsoft Windows, please download the Apache Brooklyn zip file from here{:target=“_blank”}.
Extract this zip file to a directory on your computer such as c:\Program Files\brooklyn
where c
is the letter of your operating system drive.
By default, no authentication is required and the web-console will listen on all network interfaces. For a production system, or if Apache Brooklyn is publicly reachable, it is strongly recommended to configure security. Documentation of configuration options include:
a) Vagrant
Now start Apache Brooklyn with the following command:
{% highlight bash %} $ vagrant up brooklyn {% endhighlight %}
You can see if Apache Brooklyn launched OK by viewing the log files with the command
{% highlight bash %} $ vagrant ssh brooklyn --command ‘sudo journalctl -n15 -f -u brooklyn’ {% endhighlight %}
b) Centos / RHEL 7
Apache Brooklyn should now have been installed and be running as a system service. It can stopped and started with the standard systemctl commands:
{% highlight bash %} $ systemctl start|stop|restart|status brooklyn {% endhighlight %}
The application should then output its logs to brooklyn.debug.log
and brooklyn.info.log
, please refer to the paths page for the locations of these.
c) Ubuntu / Debian
Apache Brooklyn should now have been installed and be running as a system service. It can be stopped and started with the standard service commands:
{% highlight bash %} $ sudo service brooklyn start|stop|restart|status {% endhighlight %}
The application should then output its logs to brooklyn.debug.log
and brooklyn.info.log
, please refer to the paths page for the locations of these.
d) OSX / Linux
Now start Apache Brooklyn with the following command:
{% highlight bash %} $ bin/start {% endhighlight %}
The application should then output its log to brooklyn.debug.log
and brooklyn.info.log
, please refer to the paths page for the locations of these.
e) Windows
You can now start Apache Brooklyn by running c:\Program Files\brooklyn\bin\start.bat
The application should then output its log into the console and also c:\Program Files\brooklyn\data\log\brooklyn.debug.log
and c:\Program Files\brooklyn\data\log\brooklyn.info.log
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:
By default it can be accessed by opening 127.0.0.1:8081{:target=“_blank”} in your web browser.
The rest of this getting started guide uses the Apache Brooklyn command line interface (CLI) tool, br
. This tool is both distributed with Apache Brooklyn or can be downloaded {% if site.brooklyn-version contains ‘SNAPSHOT’ %} from here. {% else %} using the most appropriate link for your OS:
For details on the CLI, see the Client CLI Reference page.
The first thing we want to do with Brooklyn is deploy a blueprint.