activemq-artemis/examples/features/ha/colocated-failover
Martyn Taylor 057047499b [maven-release-plugin] prepare release 2.0.0 2017-03-10 11:25:47 +00:00
..
src/main ARTEMIS-785 - update examples to new addressing model 2016-12-15 13:36:23 +00:00
pom.xml [maven-release-plugin] prepare release 2.0.0 2017-03-10 11:25:47 +00:00
readme.html renaming broker-features -> features on examples 2015-08-13 00:11:56 -04:00

readme.html

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

<html>
  <head>
    <title>ActiveMQ Artemis JMS Colocated Failover Example</title>
    <link rel="stylesheet" type="text/css" href="../../../common/common.css" />
    <link rel="stylesheet" type="text/css" href="../../../common/prettify.css" />
    <script type="text/javascript" src="../../../common/prettify.js"></script>
  </head>
  <body onload="prettyPrint()">
     <h1>JMS Colocated Failover Shared Store Example</h1>
     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>

     <p>This example demonstrates how you can colocate live and backup servers in the same VM. We do this by creating an
     HA Policy that is colocated. colocated means that backup servers can be created and maintained by live servers on behalf
     of other requesting live servers. In this example we create a colocated shared store server.
     <p>This example starts 2 live servers each with a backup server that backs up the other live server.</p>
     <p>The first live server will be killed and the backup in the second will become live</p>
     <p>The following shows how to configure the live servers to request and allow backups to be deployed</p>
     <pre class="prettyprint">
     <code>&lt;ha-policy>
         &lt;shared-store>
             &lt;colocated>
                 &lt;backup-port-offset>100&lt;/backup-port-offset>
                 &lt;backup-request-retries>-1&lt;/backup-request-retries>
                 &lt;backup-request-retry-interval>2000&lt;/backup-request-retry-interval>
                 &lt;max-backups>1&lt;/max-backups>
                 &lt;request-backup>true&lt;/request-backup>
                 &lt;master/>
                 &lt;slave/>
             &lt;/colocated>
         &lt;/shared-store>
     &lt;/ha-policy>
     </code>
     </pre>
     <p>notice that we have used a template to set some sensible defaults but overridden the backup strategy so back ups
     are full servers</p>
  </body>
</html>