<?xml version="1.0" encoding="UTF-8"?>
<section version="5.0" xml:id="services.ha.config" xml:lang="en"
         xmlns="http://docbook.org/ns/docbook"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:svg="http://www.w3.org/2000/svg"
         xmlns:mml="http://www.w3.org/1998/Math/MathML"
         xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns:db="http://docbook.org/ns/docbook">
  <info>
    <title>ha service configuration</title>
  </info>

  <para>The <emphasis role="bold">ha</emphasis> (High Availability) service is
  required in order to replicate stateful session beans (SFSBs).</para>

  <para>The <emphasis role="bold">ha</emphasis> service uses JGroups as a
  group communication protocol (GCP).</para>

  <para>Here is the part of <filename>jonas.properties</filename> related to
  <emphasis role="bold">ha</emphasis> service:</para>

  <screen>###################### JOnAS HA service configuration
#
# Set the name of the implementation class of the HA service.
jonas.service.ha.class    org.ow2.jonas.ha.internal.HaServiceImpl

# Set the JGroups configuration file name
jonas.service.ha.jgroups.conf jgroups-ha.xml <co xml:id="jgroups.conf" />

# Set the JGroups group name
jonas.service.ha.jgroups.groupname jonas-rep <co xml:id="jgroups.groupname" />

# Set the SFSB backup info timeout. The info stored in the backup node is removed when the timer expires.
jonas.service.ha.gc.period 600 <co xml:id="gc.period" />

# Set the datasource for the tx table
jonas.service.ha.datasource jdbc_1 <co xml:id="datasource" />

# Reconnection timeout for JGroups Channel, if it's closed on request.
jonas.service.ha.reconnection.timeout 5000 <co xml:id="reco.timeout" /></screen>

  <para><calloutlist>
      <callout arearefs="jgroups.conf">
        <para>Set the name of the JGroups configuration file.</para>
      </callout>

      <callout arearefs="jgroups.groupname">
        <para>Set the name of the JGroups group.</para>
      </callout>

      <callout arch="" arearefs="gc.period">
        <para>Set the period of time (in seconds) the system waits before
        cleaning useless replication information.</para>
      </callout>

      <callout arearefs="datasource">
        <para>Set the JNDI name of the datasource corresponding to the
        database where is located the transaction table used by the
        replication mechanism.</para>
      </callout>

      <callout arearefs="reco.timeout">
        <para>Set the delay to wait for a reconnection.</para>
      </callout>
    </calloutlist></para>

  <note>
    <para>Refer to <link xlink:href="clustering_guide.html#faq.jgroups">the
    clustering guide</link> for issues related to JGroups.</para>
  </note>
</section>
