A Blacksmith Forge for deploying dedicated standalone with dashboard
Go to file
Jason 45532d5868 addition of relase notes 2022-05-25 10:04:00 -04:00
.final_builds release v0.5.15 2022-05-17 12:38:33 +00:00
ci addition of relase notes 2022-05-25 10:04:00 -04:00
config Update RabbitMQ to 3.8.28 2022-03-23 18:27:44 -07:00
docs/diag Add missing diagrams 2018-01-18 16:22:56 -05:00
jobs Added in plan expansion to allow users to use rabbitmq dashboard with 2022-05-23 20:23:58 -04:00
packages Added initial TLS support structure. 2022-03-31 14:08:14 +00:00
releases/rabbitmq-forge release v0.5.15 2022-05-17 12:38:33 +00:00
src Initial scaffold 2017-04-27 15:57:04 -07:00
.gitignore Initial scaffold 2017-04-27 15:57:04 -07:00
CONDUCT.md Add Contributing guidleines / Code of Conduct 2019-10-21 13:03:38 -04:00
CONTRIBUTING.md Add Contributing guidleines / Code of Conduct 2019-10-21 13:03:38 -04:00
LICENSE MIT 2018-01-10 15:46:38 -05:00
README.md added mgmt and dashboard url to credentials (#8) 2018-12-12 16:40:59 -05:00

README.md

Blacksmith RabbitMQ Forge

This Blacksmith Forge teaches a Blacksmith Broker how to deploy standalone and clustered RabbitMQ service deployments for message bus applications.

Deploying

To deploy this forge, you will need to add it to your existing Blacksmith Broker manifest deployment, co-locating the rabbitmq-blacksmith-plans job on the Blacksmith instance group.

Here's an example to get you started (clipped for brevity):

releases:
  - name:    rabbitmq-forge
    version: latest

instance_groups:
  - name: blacksmith
    jobs:
      - name:    rabbitmq-blacksmith-plans
        release: rabbitmq-forge
        properties:
          plans:
            # your plans here
            # (see below)

The RabbitMQ Forge deploys rabbitmq by using jobs that are found inside the rabbitmq-forge BOSH release, which means that your Blacksmith BOSH director also needs that release. Blacksmith is able to upload that release for you, if you want.

For the Spruce users out there:

---
instance_groups:
  - name: blacksmith
    jobs:
      - name: blacksmith
        properties:
          releases:
            - (( append ))
            - (( grab releases.rabbitmq-forge ))

Finally, you'll need to define plans for Blacksmith to deploy. The following sections discuss those ad nauseum.

Standalone Topology

The standalone topology is as straightforward as they come: a singe dedicated VM that runs a single RabbitMQ process, bound on all interfaces, to port 5672, with a management UI on 15672.

Here's a diagram to clear things up:

Standalone Topology Diagram

Configuration Options

  • vm_type - The name of a BOSH vm_type from your cloud-config. You can use this to size your RabbitMQ appropriate to your workload requirements, in terms of RAM and CPU. Increasing the disk size via the VM type is not going to net you much of a gain (see the disk_size and persist options instead.

  • network - The name of the network to deply these instances to. This network should be defined in your cloud-config, and should be large enough to handle your anticipated service footprint. It does not need any static IP addresses.

    By default, VMs will be deployed into a network named rabbitmq-service.

Example Configuration

A single standalone plan:

instance_groups:
  - name: blacksmith
    jobs:
      - name:    rabbitmq-blacksmith-plans
        release: rabbitmq-forge
        properties:
          plans:
            dedicated:
              type: standalone

Clustered Topology

The cluster topology scales up the RabbitMQ instances and sets them up in a message bus cluster, striping across BOSH availability zones.

Here's a diagram:

Cluster Topology Diagram

Configuration Options

  • vm_type - The name of a BOSH vm_type from your cloud-config. You can use this to size your RabbitMQ appropriate to your workload requirements, in terms of RAM and CPU.

  • azs - A list of BOSH availability zone names (per cloud-config), across which to stripe the nodes. By default, nodes will be put in z1 and z2.

  • network - The name of the network to deply these instances to. This network should be defined in your cloud-config, and should be large enough to handle your anticipated service footprint. It does not need any static IP addresses.

    By default, VMs will be deployed into a network named rabbitmq-service.

Example Configuration

Here's the configuration for the cluster pictured in the topology digram above:

instance_groups:
  - name: blacksmith
    jobs:
      - name:    rabbitmq-blacksmith-plans
        release: rabbitmq-forge
        properties:
          plans:
            clustered:
              type:      cluster
              instances: 3

Here, we provide two different clustered configurations, one with lots of nodes, and another with very large (per cloud-config) nodes.

instance_groups:
  - name: blacksmith
    jobs:
      - name:    rabbitmq-blacksmith-plans
        release: rabbitmq-forge
        properties:
          plans:
            wide:
              type:      cluster
              instances: 7

            large:
              type:     cluster
              vm_type:  very-large

Service Credentials

The standalone topology returns the following credentials structure, for consumption by Cloud Foundry 12-factor applications:

{
  "dashboard_url" : "http://10.x.x.x:15672/#/login/username/sekrit",
  "host"          : "10.x.x.x",
  "hostname"      : "10.x.x.x",
  "mgmt_port"     : 15672,
  "password"      : "sekrit",
  "protocols"     : {
    "amqp"        : {
    "host"        : "10.x.x.x",
    "password"    : "sekrit",
    "port"        : 5672,
    "uri"         : "amqp://some-user:sekrit@10.x.x.x:5672",
    "username"    : "some-user",
    "vhost"       : "/"
   },
    "management": {
    "host"        : "10.x.x.x",
    "password"    : "sekrit",
    "path"        : "/api",
    "port"        : 15672,
    "ssl"         : false,
    "uri"         : "http://some-user:sekrit@10.x.x.x:15672/api",
    "username"    : "some-user"
   }
  },
  "rmq_port"      : 5672,
  "uri"           : "amqp://some-user:sekrit@10.x.x.x:5672",
  "username"      : "some-user",
  "vhost"         : "/"
}

  • dashboard_url - The URL to access the RabbitMQ management GUI.

  • host - The IP address of the standalone RabbitMQ host. hostname and host are interchangeable.

  • vhost - The name of the virtual host that the user's permissions apply to.

  • mgmt_port - The TCP port that the RabbitMQ management web interface can be accessed via.

  • rmq_port - The TCP port that RabbitMQ's AMQP interface is bound to and listening for inbound connections on.

  • username - The administrator account username.

  • password - The administrator account password.

  • uri - An amqp://... URL that can be used for accessing RabbitMQ. It contains all of the other values, in a URL / DSN for easier integration with libraries / SDKs.

The section in the protocols block is to provide Pivotal RabbitMQ equivalent credentials formatting to applications. Please check Pivotal documentation on RMQ Credentials format for more details.

The clustered topology returns the following credentials structure, for consumption by Cloud Foundry 12-factor applications:

{
  "dashboard_url" : "http://10.x.x.x:15672/#/login/username/sekrit",
  "hostname"      : "10.x.x.x",
  "hostnames"     : ["10.x.x.x", "10.x.x.y", "10.x.x.z"],
  "hosts"         : ["10.x.x.x", "10.x.x.y", "10.x.x.z"],
  "mgmt_port"     : 15672,
  "password"      : "sekrit",
  "protocols"     : {
    "amqp"        : {
    "host"        : "10.x.x.x",
    "hosts"       : ["10.x.x.x", "10.x.x.y", "10.x.x.z"],
    "password"    : "sekrit",
    "port"        : 5672,
    "uri"         : "amqp://some-user:sekrit10.x.x.x:5672",
    "uris"        : ["amqp://some-user:sekrit@10.x.x.x:5672",
                     "amqp://some-user:sekrit@10.x.x.y:5672",
                     "amqp://some-user:sekrit@10.x.x.z:5672"]
    "username"    : "some-user",
    "vhost"       : "/"
   },
    "management": {
    "host"        : "10.x.x.x",
    "password"    : "sekrit",
    "path"        : "/api",
    "port"        : 15672,
    "ssl"         : false,
    "uri"         : "http://some-user:sekrit@10.x.x.x:15672/api",
    "uris"        : ["http://some-user:sekrit@10.x.x.x:15672/api",
                     "http://some-user:sekrit@10.x.x.y:15672/api",
                     "http://some-user:sekrit@10.x.x.z:15672/api"]
    "username"    : "some-user"
   }
  },
  "rmq_port"      : 5672,
  "uri"           : "amqp://some-user:sekrit10.x.x.x:5672",
  "username"      : "some-user",
   "vhost"        : "/"
}
  • dashboard_url - The URL to access the RabbitMQ management GUI.

  • rmq_port - The TCP port that RabbitMQ's AMQP interface is bound to and listening for inbound connections on.

  • mgmt_port - The TCP port that the RabbitMQ management web interface can be accessed via.

  • hosts - A list of the IP addresses of all cluster nodes. hostnames and hosts are interchangeable.

  • vhost - The name of the virtual host that the user's permissions apply to.

  • username - The administrator account username.

  • password - The administrator account password.

  • uri - An amqp://... URL that can be used for accessing the first (arbitrary) cluster node member. This is provided mainly for backwards compatibility with applications that want to upgrade from the standalone topology, but don't (yet) support multiple RMQ URLs.

  • uris - A list of amqp://... URLs that can be used for accessing each cluster node individually. Resilient applications should use this list to failover on node failure.

The section in the protocols block is to provide Pivotal RabbitMQ equivalent credentials formatting to applications. Please check Pivotal documentation on RMQ Credentials format for more details.

Contributing

If you find a bug, please raise a Github Issue first, before submitting a PR.