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.

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 (JRE) 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.

Install Apache Brooklyn

Hint: in the top right of this page are buttons to select an operating system. Choose your operating system to see the most appropriate instructions here.

Installing with Vagrant

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-1.1.0-SNAPSHOT-vagrant folder (note: as this is a -SNAPSHOT version, your filename will be slightly different)

$ tar xvf apache-brooklyn-1.1.0-SNAPSHOT-vagrant.tar.gz
$ cd apache-brooklyn-1.1.0-SNAPSHOT-vagrant

Installing on CentOS & Red Hat Enterprise Linux 7

Please note, an RPM is not available for snapshot builds

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.

This is a snapshot build and no RPM is available, please download a different version.

Once downloaded, run the following shell command as root:

$ yum install apache-brooklyn-1.1.0-SNAPSHOT-1.rpm

Installing on Ubuntu 7 Debian

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.

Download the Apache Brooklyn deb distribution.

Once downloaded, run the following shell command:

$ sudo dpkg -i apache-brooklyn_1.1.0-SNAPSHOT_noarch.deb

Installing on other Linux distributions, OSX and other UNIX-like platforms

For Linux or OSX please download the Apache Brooklyn tar.gz archive from the download section.

Extract the tar.gz archive (note: as this is a -SNAPSHOT version, your filename will be slightly different):

$ tar -zxf apache-brooklyn-dist-1.1.0-SNAPSHOT-timestamp-dist.tar.gz
$ cd apache-brooklyn-1.1.0-SNAPSHOT

Installing on Windows

For all versions of Microsoft Windows, please download the Apache Brooklyn zip file from here.

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:

Launch Apache Brooklyn

Important

Before launching Apache Brooklyn, please check the date on the local machine. Even several minutes before or after the actual time could cause problems.

Launching in Vagrant

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'

Launching on CentOS & Red Hat Enterprise Linux 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:

$ systemctl start|stop|restart|status brooklyn

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.

Launching on 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:

$ sudo service brooklyn start|stop|restart|status

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.

Launching on other Linux distributions, OSX and other UNIX-like platforms

Now start Apache Brooklyn with the following command:

$ bin/start

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.

Launching on 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

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) tool, br. This tool is both distributed with Apache Brooklyn or can be downloaded from here.

For details on the CLI, see the Client CLI Reference page.

Next

The first thing we want to do with Brooklyn is deploy a blueprint.

results matching ""

    No results matching ""