66 lines
3.4 KiB
HTML
66 lines
3.4 KiB
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 Scale Down 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 Recover Only 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 that will scale down.
|
|
That is it will not become live but scale down the journal to the colocated live server.
|
|
<p>This example starts 2 live servers each will request the other to create a backup.</p>
|
|
<p>The first live server will be killed and the backup in the second will recover the journal and recreate its state
|
|
in the live server it shares its VM with.</p>
|
|
<p>The following shows how to configure the backup, the slave is configured <b><scale-down/></b> which means
|
|
that the backup server will not fully start on fail over, instead it will just recover the journal and write it
|
|
to its parent live server.</p>
|
|
<pre class="prettyprint">
|
|
<code><ha-policy>
|
|
<shared-store>
|
|
<colocated>
|
|
<backup-port-offset>100</backup-port-offset>
|
|
<backup-request-retries>-1</backup-request-retries>
|
|
<backup-request-retry-interval>2000</backup-request-retry-interval>
|
|
<max-backups>1</max-backups>
|
|
<request-backup>true</request-backup>
|
|
<master/>
|
|
<slave>
|
|
<scale-down/>
|
|
</slave>
|
|
</colocated>
|
|
</shared-store>
|
|
</ha-policy>
|
|
</code>
|
|
</pre>
|
|
<p>Notice that we dont need to specify a scale down connector as it will use most appropriate
|
|
from the list of available connectors which in this case is the first INVM connector</p>
|
|
<p> One other thing to notice is that the cluster connection has its reconnect attempts set to 5, this is so it will
|
|
disconnect instead of trying to reconnect to a backup that doesn't exist.</p>
|
|
</body>
|
|
</html>
|