This is a guest post by our friends at Cloudsoft (link) on the Apache Brooklyn project (link). We’re excited to be collaborating with Cloudsoft. The cloud is the new operating system, and projects like Apache Brooklyn enable the enterprise to be more efficient. What if you could deploy a dozen instances of Couchbase Server to Amazon Web Services with the click of a button?

Couchbase blueprints are now available in Apache Brooklyn!

@ZaidM (GitHub) and @Nakomis (GitHub) have been busy on Github working with Couchbase to add support for the extremely scalable, high-performance JSON document store. With their latest commit (link), provisioning a cluster is as easy as writing:

name: My Couchbase Cluster
– type: brooklyn.entity.nosql.couchbase.CouchbaseCluster
initialSize: 3location:
identity: your-gce-acct
credential: your-gce-token

Simply follow the instructions, unpack, and run “bin/brooklyn launch”, then go to the web console and paste the YAML above (with your credentials).

As soon as you deploy, the topology is shown and you can track provisioning and command execution. It all runs in parallel, due to how Brooklyn manages processing, apart from where there is an explicit dependency — such as needing to know a subset of Couchbase nodes in order for the webapp to connect. And it will run in many locations, from Amazon to OpenStack, by way of Docker or non-cloud pre-existing machines.

After a few minutes, it’s completed, and metrics from Couchbase are monitored to ensure it’s running well and drive your custom management policies such as DR and autoscaling as we’ll show below. The sensors tabs also show the URLs for management and endpoints for clients to connect to.


Of course in the real world you need more. That’s where the power of the Brooklyn project shines and your Couchbase automation sparkles. Let’s illustrate a more interesting YAML which shows how to:

  • customizing Couchbase credentials
  • specify the hardware spec (portable across many clouds)
  • attaching a scaling policy
  • deploying Couchbase alongside some front-end applications

This last bullet point is especially powerful: you can use the same open-source tool chain to deploy and manage the applications around Couchbase as you use for Couchbase itself. This enables integration testing at scale, fully automated, and version-controlled blueprints for entire stacks.

Let’s use as an example a Couchbase load-generator webapp developed by @Neykov (link).

We’ll define a policy which seeks to keep operations-per-node in the range of 500-1000. This is nothing for Couchbase on such beefy hardware, of course, but it’s a range we can comfortably demonstrate! Once we’ve got Couchbase deployed and our web app deployed, you can create the bucket in Couchbase through it’s GUI (using the credentials in the YAML below), and then start the two load generators. If you need more load generators, use the “effectors” tab to “resize” the load-gen cluster, and as you start to drive 3000+ ops/sec through Couchbase, you’ll observe it scaling up as per the policy.

Here’s the bigger, real-world YAML code in all its glory, here running in Softlayer:

name: My Couchbase with Elastic Load Generator


– type: brooklyn.entity.nosql.couchbase.CouchbaseCluster
id: cb-cluster
adminUsername: Administrator
adminPassword: Password
initialSize: 3
minRam: 16384
minCores: 4
– type: brooklyn.policy.autoscaling.AutoScalerPolicy
metric: $brooklyn:sensor(“brooklyn.entity.nosql.couchbase.CouchbaseCluster”,
metricLowerBound: 500
metricUpperBound: 1000
minPoolSize: 3
maxPoolSize: 8

– type: brooklyn.entity.webapp.ControlledDynamicWebAppCluster
name: Web Couchbase Load Gen Cluster
minCores: 4
brooklyn.example.couchbase.nodes: $brooklyn:formatString(“‘%s'”,
initialSize: 2

identity: your-sl-acct
credential: your-sl-api-access-key

About Cloudsoft

Cloudsoft is the leading open source application management company. Cloudsoft AMP is the commercially supported version of Apache Brooklyn, a framework for modeling, monitoring and managing applications through autonomic blueprints currently undergoing incubation at the Apache Software Foundation. Leverages Apache jclouds (link). AMP delivers multi-cloud policy-based application governance and compliance. AMP has been adopted by enterprises, ISVs and systems integrators such as IBM Cloud Services.


Posted by Shane Johnson, Director, Product Marketing, Couchbase

Shane K Johnson was the Director of Product Marketing at Couchbase. Prior to Couchbase, he occupied various roles in developing and evangelism with a background in Java and distributed systems. He has consulted with organizations in the financial, retail, telecommunications, and media industries to draft and implement architectures that relied on distributed systems for data and analysis.

One Comment

  1. Brooklyn is fantastic — but I\’ve found and fixed a bug with the sync gateway. I want to write a test for it. How on earth do I build Brooklyn from source, and how do I package it for distribution and test that my tweak worked? You can see the change here:

Leave a reply