Zero to Fuse Fabric Ensemble

If you're getting started with Fuse for the first time, or maybe jumping back into the technology, you'll need to instantiate an environment. Many quick-start type articles may have you install a single-host fabric on your local machine, which may very well suit your needs and let you get a feel for the product. I find, however, that if a multi-host Fabric ensemble is the desired production state, you'll want a development environment to match as early as possible. The following is my procedure for setting up a three-host Fabric ensemble on remote virtual machines, along with some Ansible roles that help me repeat the process quickly and easily.


So what do you need in terms of virtual machines?

I tested this procedure out on 3 VMs with only 1 CPU, 2G RAM, and 20G of local storage. To be honest, you could get away with even less local storage, but if you want to test out some persistent messaging, it's always good to have some space.

Note that depending on the target broker topology, you may want to revisit storage, as a proper master-slave setup will usually involve some shared volumes - as in network-mounted, but local storage should be okay for a baseline network-of-brokers.

Regarding 1 CPU and 2G RAM, surely, you'd want to scale that up a bit. This is a starting point, and could potentially support about three JVMs per host (nine total). You'll have one "root" container on each host, just to run the ensemble, leaving you with capacity for only about six child containers (when JVM defaults are used). This may be enough for a POC, but I recommend doubling or quadrupling, if the resources are available.

I've tested the Ansible bits against RHEL 7.2, so theoretically, CentOS distributions should be okay too. Ansible relies on SSH access to the remote VMs, so make sure to set up a working SSH key-based auth to a user that has sudo rights.

Local Environment Prereqs

You'll need Ansible installed. Depending on the OS you're working with locally, the installation varies. See Ansible Installation for more details.

Make sure you note the path to the private SSH key that will be used to authenticate against the remote VMs. We will point to this key in the Ansible inventory configuration. It does not have to be your user's default SSH key.

Finally, make sure you have a copy of the Fuse installation binary. I've been testing with from The JBoss Community or from Red Hat.

Configure the Playbook

I've developed a sample playbook here, but it will require some configuration.

First, take a look at the hosts.example file. Copy this file and name it hosts, for example. You'll notice two host groups, fuse and fabric. The simplest configuration is to include all hosts in both groups. This means that the fuse and fabric roles will be applied to all hosts, take a look at playbook.yml to observe the roles-to-groups association. Three things are configured in the inventory file: the IPs or DNS entries for each of the VMs, the Linux user that Ansible should use, and the path to the private key(s) that Ansible should use for authentication.

Place the Fuse zip file in roles/fuse/files.

Lastly, take a look at group_vars/all. Some essential variables are configured there. If you're using RHEL you may want to configure your credentials there.

Run the Playbook

Now that everything is configured, run:

ansible-playbook -i hosts playbook.yml

Let me know about your experience!

comments powered by Disqus