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.
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.