ActiveBlog

ActiveMQ on Stackato
by Matthew Fisher

Matthew Fisher, October 03, 2013
Apache ActiveMQ

A new service just rolled off the press. One of our customers has graciously allowed us to open-source a service plugin that they created by following our blog post on creating custom services. Thanks to their help, ActiveMQ is now available as a data service on Stackato!

As mentioned in the README, this plugin is still under active development and is not considered ready for production use. We’ve tested it with Stackato v2.10.6 though, and would encourage you to do the same if you’d like to use it.

Setting it up

Since the plugin is based off of our elasticsearch plugin, the deployment process is the same as for Elasticsearch:

  1. Log in to your Stackato micro cloud and clone the repository from Github:

    ssh stackato@stackato-xxxx.local
      ...
      git clone https://github.com/ActiveState/stackato-activemq-service.git
      ...
      cd stackato-activemq-service
  2. Edit the ‘cloud_controller_uri’ line in the config/activemq_gateway.yml file to reflect - you guessed it - your Cloud Controller’s URI.

    vim config/activemq_gateway.yml
  3. Run the install-activemq.sh script to install ActiveMQ for the ‘stackato’ user under /opt/activemq along with all dependencies it relies on. If you want to install a newer/older version of ActiveMQ, change the VERSION variable to your needs.

    sudo ./scripts/install-activemq.sh
  4. Run the bootstrap script:

    ./scripts/bootstrap.sh

    Bootstrapping runs all of the commands specified within the echo service example, including installing the service gems, installing to supervisord and kato, loading into Doozer, adding the service AUTH token to the Cloud Controller, adding activemq as a role and restarting kato. After all this is done, you should be able to see activemq as a useable service in the Stackato client.

  5. You’ll also want to edit /s/vcap/common/lib/vcap/services_env.rb to add ACTIVEMQ_URL for all your apps that bind to an ActiveMQ service:

    only_item(vcap_services['activemq']) do |s|
        c = s[:credentials]
        e["ACTIVEMQ_URL"] = "tcp://#{c[:username]}:#{c[:password]}@#{c[:host]}:#{c[:port]}/#{c[:name]}"
      end

Trying it out

Once all this is done and you’ve targeted and authenticated with the stackato client, you can test out the installation yourself:

  $ stackato services
  
  ============== System Services ==============
  
  +---------------+---------+------------------------------------------------+
  | Service       | Version | Description                                    |
  +---------------+---------+------------------------------------------------+
  | activemq      | 1.0     | ActiveMQ full-text searching and indexing      |
  | filesystem    | 1.0     | Persistent filesystem service                  |
  | harbor        | 1.0     | External port mapping service                  |
  | memcached     | 1.4     | Memcached in-memory object cache service       |
  | mongodb       | 2.4     | MongoDB NoSQL store                            |
  | mysql         | 5.5     | MySQL database service                         |
  | postgresql    | 9.1     | PostgreSQL database service                    |
  | rabbitmq      | 2.4     | RabbitMQ message queue                         |
  | redis         | 2.6     | Redis key-value store service                  |
  +---------------+---------+------------------------------------------------+
  
  =========== Provisioned Services ============
  
  $ stackato create-service activemq
  Creating Service [activemq-be13d]: OK
  $ stackato service activemq-be13d
  
  activemq-be13d
  +-------------+--------------------------------------+
  | What        | Value                                |
  +-------------+--------------------------------------+
  | credentials |                                      |
  | - host      | 192.168.69.147                       |
  | - hostname  | 192.168.69.147                       |
  | - name      | 5fec7340-befe-448e-bb19-648f5601bfb7 |
  | - node_id   | activemq_node_1                      |
  | - port      | 9200                                 |
  |             |                                      |
  | email       | s@s.com                              |
  | meta        |                                      |`
  | - created   | Tue Jul 09 12:14:42 PDT 2013         |
  | - tags      | activemq                             |
  | - updated   | Tue Jul 09 12:14:42 PDT 2013         |
  | - version   | 1                                    |
  |             |                                      |
  | properties  |                                      |
  | tier        | free                                 |
  | type        | generic                              |
  | vendor      | activemq                             |
  | version     | 1.0                                  |
  +-------------+--------------------------------------+
  
  

If anyone is interested in adding a service to Stackato, please feel free to contact me.

Happy hacking!

Subscribe to ActiveState Blogs by Email

Category: stackato
About the Author: RSS

Matthew Fisher is ActiveState’s Junior Product Manager. Born and raised on Vancouver Island, BC, Matthew is a software developer in his spare time, preferring Python as his weapon of choice. In December 2012, he graduated from the British Columbia Institute of Technology with a Diploma in Computer Systems Technology. He has previously built telephony systems for customers using Asterisk PBX and Django, and has completed co-op placements doing IT/Sys Admin work with Core Information Technology and AeroInfo Systems, where he received an AeroInfo Award of Excellence. He joined ActiveState in February 2013.