Book Image

Apache Karaf Cookbook

By : Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler
Book Image

Apache Karaf Cookbook

By: Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler

Overview of this book

Table of Contents (17 chapters)
Apache Karaf Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Configuring and deploying a master/slave broker with Apache Karaf


In this recipe, we will set up and deploy two Karaf instances with embedded ActiveMQ in a master/slave configuration. This is used for high availability in messaging systems. This will allow systems to continue functioning in case of a failure of the active instance.

Getting ready

First we need to get two instances of Karaf started up with an embedded broker. If we are doing this on two different machines, it is actually easier since we will not have port conflicts when using the defaults on both machines. Keep in mind that if you decide to run this deployment on a single machine, one of the instances of Jetty and ActiveMQ embedded in Karaf needs to have its ports changed.

How to do it…

Since we can only assume that we have one machine to work with, we will go over how to get two instances of Karaf running on a single machine. We can create a second instance by unzipping the Karaf .zip or .tar file to a new directory or just copy...