blob: 0ee71b2981752caabe9a58a03cb46a184965be75 [file] [log] [blame]
<div class="docbook"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">H.2. Creation of BDB HA group using an initial configuration.</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="Java-Broker-Appendix-BDB-HA-initial-configuration.html">Prev</a> </td><th width="60%" align="center">Appendix H. BDB HA initial configuration</th><td width="20%" align="right"> <a accesskey="n" href="Java-Broker-Docker.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Java-Broker-Appendix-BDB-HA-initial-configuration-creation"></a>H.2. Creation of BDB HA group using an initial configuration.</h2></div></div></div><p>Let's create a BDB HA group with name <code class="literal">weather</code>
consisting of tree nodes <code class="literal">weather1</code>, <code class="literal">weather2</code>, and <code class="literal">weather3</code>
using the initial configuration above. We start node <code class="literal">weather1</code> on host/port
<code class="literal">chaac:5000</code>, node <code class="literal">weather2</code> on host/port <code class="literal">indra:5000</code>
and node <code class="literal">weather3</code> on host/port <code class="literal">thor:5000</code>.</p><p>The node <code class="literal">weather1</code> can be created with the following command</p><pre class="screen">
$ ./qpid-server -icp ./initial-config.json -prop ha.node_name=weather1 -prop ha.node_address=chaac:5000 \
-prop ha.group_name=weather -prop ha.helper_address=chaac:5000 -prop ha.helper_node_name=weather1 \
-prop ha.permitted_nodes="[\"chaac:5000\",\"indra:5000\",\"thor:5000\"]" -prop ha.priority=3 \
-prop qpid.amqp_port=10000 -prop qpid.http_port=20000
</pre><p>Please note, the broker is started with initial configuration at file <code class="literal">./initial-config.json</code>.
The context variable for node name <code class="literal">ha.node_name</code> is set to <code class="literal">weather1</code>.
The node address context variable <code class="literal">ha.node_address</code> is set to <code class="literal">chaac:5000</code>.
As it is a first node, the helper address is set to the same address as a node address (<code class="literal">ha.helper_address=chaac:5000</code>)
and the helper node name is to itself (<code class="literal">ha.helper_node_name=weather1</code>). The group name is set to <code class="literal">weather</code>
with <code class="literal">ha.group_name=weather</code>. The group nodes are listed in <code class="literal">ha.permitted_nodes</code>.
The amqp and http ports are overridden to 10000 and 20000 accordingly. The node priority is set to <code class="literal">3</code>.
</p><p>The node <code class="literal">weather2</code> can be created on host<code class="literal">indra</code> with the following command:</p><pre class="screen">
$ ./qpid-server -icp ./initial-config.json -prop ha.node_name=weather2 -prop ha.node_address=indra:5000 \
-prop ha.group_name=weather -prop ha.helper_address=chaac:5000 -prop ha.helper_node_name=weather1 \
-prop ha.permitted_nodes="[\"chaac:5000\",\"indra:5000\",\"thor:5000\"]" -prop ha.priority=2 \
-prop qpid.amqp_port=10001 -prop qpid.http_port=20001
</pre><p>
The context variable for node name <code class="literal">ha.node_name</code> is set to <code class="literal">weather2</code>.
The node address context variable <code class="literal">ha.node_address</code> is set <code class="literal">indra:5000</code>.
The amqp and http ports are overridden to 10001 and 20001 accordingly. The node <code class="literal">weather2</code>
priority is set to <code class="literal">2</code>. The rest of the context variables have
the same values as for node <code class="literal">weather1</code>. The latter is used as a helper node for creation of
<code class="literal">weather2</code>.
</p><p>The node <code class="literal">weather3</code> can be created on host<code class="literal">thor</code> with the following command:</p><pre class="screen">
$ ./qpid-server -icp ./initial-config.json -prop ha.node_name=weather3 -prop ha.node_address=thor:5000 \
-prop ha.group_name=weather -prop ha.helper_address=chaac:5000 -prop ha.helper_node_name=weather1 \
-prop ha.permitted_nodes="[\"chaac:5000\",\"indra:5000\",\"thor:5000\"]" -prop ha.priority=1 \
-prop qpid.amqp_port=10002 -prop qpid.http_port=20002
</pre><p>
The context variable for node name <code class="literal">ha.node_name</code> is set to <code class="literal">weather3</code>.
The node address context variable <code class="literal">ha.node_address</code> is set <code class="literal">thor:5000</code>.
The amqp and http ports are overridden to 10002 and 20002 accordingly. The node <code class="literal">weather3</code>
priority is set to <code class="literal">1</code>. The rest of the context variables have
the same values as for node <code class="literal">weather1</code> which is used as a helper node for creation of
<code class="literal">weather3</code>.
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="Java-Broker-Appendix-BDB-HA-initial-configuration.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="Java-Broker-Appendix-BDB-HA-initial-configuration.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="Java-Broker-Docker.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix H. BDB HA initial configuration </td><td width="20%" align="center"><a accesskey="h" href="Apache-Qpid-Broker-J-Book.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 12. Docker Images</td></tr></table></div></div>