blob: 6a32855e0949009a89b7fe22cb297ac4b456c09d [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<chapter id="clustering"
xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://docbook.org/ns/docbook
http://www.docbook.org/xml/5.0/xsd/docbook.xsd"
version="5.0" xml:lang="en">
<title>Clustering and High Availability</title>
<para>
ServiceMix supports both High Availability (HA) and clustering of containers.
</para>
<section id="ha">
<title>High Availability (HA)</title>
<para>
High Availability (HA) can be defined as two distinct ServiceMix container instances configured in a master/slave
configuration. In all cases, the master is <emphasis>active</emphasis> and the slave is in <emphasis>standby</emphasis>
mode waiting for a failover event to trigger it to take over.
</para>
<para>
<itemizedlist>
<listitem><para><emphasis>Active</emphasis>: components are listening for and servicing requests.</para></listitem>
<listitem><para><emphasis>Standby</emphasis>: administrative ports may be open (e.g. JMX) but the process is not listening for or servicing requests.</para></listitem>
</itemizedlist>
</para>
<para>
As ServiceMix leverages ActiveMQ to provide HA availability, there are a few choices in terms of how to configure
master/slave via ActiveMQ:
<itemizedlist>
<listitem><para><emphasis>Shared Filesystem Master-Slave</emphasis> - with shared database master/slave
two containers use the same physical data store container state. Care should be taken to ensure
that the file system supports file level locking as this is the mechanism used to select the master.
If the master process exists, the database lock is released and the slave acquires it and it then
becomes the master.</para></listitem>
<listitem><para><emphasis>JDBC Master-Slave</emphasis> - In JDBC master/slave, the master will lock
a table in the backend database. The failover event in this case is that the lock is released from
the database.</para></listitem>
<listitem><para><emphasis>Pure Master-Slave</emphasis> - With pure master/slave either a shared database
or a shared filesystem can be used. The master replicates all state changes to the slave so there
is additional overhead incurred. The failover trigger in pure master/slave is that the slave loses
its network connection to its master.</para></listitem>
</itemizedlist>
</para>
<para>
</para>
<section id="clustering">
<title>Clustering</title>
<para>
A cluster can be defined as two or more ACTIVE ServiceMix container instances that are networked together.
A cluster provides the following benefit:
<itemizedlist>
<listitem><para>Connectivity to other ServiceMix containers forming a network of containers.
Containers can be dynamically added and removed from the network.</para></listitem>
<listitem><para>Remote component awareness where each container is aware of its peer container's components.
Networked containers listen for remote component registration/deregistration events and once
aware can route request to those components.</para></listitem>
</itemizedlist>
</para>
</section>
</section>
</chapter>