Added by Max Pfingsthorn, last edited by Bart van der Schans on Jul 05, 2007  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Repository Clustering

This configuration is optional!

Version 1.2.9 of the Hippo Repository implements support for running multiple instances which access the same database. The main purpose of the clustering configuration is that Slide (which Hippo Repository is built on) has a cache which needs to be flushed for documents that are added, updated or deleted through another instance to the shared database. The clustering messages and node discovery is done with jgroups

The cluster the repository the following steps are needed:

  1. use the same database for both repositories
  2. use SERIALIZABLE instead of READ_COMMITTED in the definition.xml
  3. create a jgroups config file
  4. enable jgroups clustering in build props and point to the config

Use isolation level SERIALIZABLE

In the definition.xml of the namespace that has to be clustered, change:

<parameter name="isolation">READ_COMMITTED</parameter>

to:

<parameter name="isolation">SERIALIZABLE</parameter>

Create a jgroups config file:

An example jgroups file in which the nodes are defined and use TCP communication:

<?xml version="1.0"?>
<config>
     <TCP
          bind_addr="10.2.2.12"
          start_port="5055"/>
     <TCPPING
          initial_hosts="10.2.2.12[5055],10.2.2.11[5055]"
          port_range="5"
          timeout="3000"
          num_initial_members="3"
          up_thread="true"
          down_thread="true"/>
     <MERGE2
          min_interval="5000"
          max_interval="10000"/>
     <FD_SOCK/>
     <VERIFY_SUSPECT
          up_thread="false"
          down_thread="false"
          timeout="1500"/>
     <pbcast.NAKACK
          up_thread="false"
          down_thread="false"
          max_xmit_size="8096"
          gc_lag="50"
          retransmit_timeout="600,1200,2400,4800"/>
     <UNICAST
          timeout="600,1200,2400,4800" />
     <pbcast.STABLE
          up_thread="false"
          down_thread="false"
          desired_avg_gossip="20000"/>
     <FRAG
          frag_size="8096"
          down_thread="false"
          up_thread="false"/>
     <pbcast.GMS
          up_thread="false"
          down_thread="false"
          join_timeout="5000"
          join_retry_timeout="2000"
          shun="false"
          print_local_addr="true"/>
</config>

For more option like autodiscovery of nodes see the jgroups site.

Enable jgroups clustering in the build properties

# ------------------------------------------------------------------------
# Cluster settings
# ------------------------------------------------------------------------
repository.cluster.jgroups.use=true
repository.cluster.jgroups.stack=/home/repository/config/jgroups.xml
repository.cluster.jgroups.groupname=hippo-repository-cluster

Otherwise, if you do not want to rebuild, open hippo-repository-<version>/config/slide/components.xconf and locate the "jgroups=cluster-propagator" element. You will see something like this:

<jgroups-cluster-propagator id="jgroups-cluster-propagator" logger="slide.jgroups-cluster">
    <enabled>false</enabled>
    <!-- xml configuration file for the JGroups Protocol Stack (absolute!) -->
    <stack src=""/>
    <!-- The group name to join, unique for each cluster, shared among nodes in one cluster -->
    <group name="hippo-repository-cluster"/>
  </jgroups-cluster-propagator>

Set enabled to "true" and point the stack src to the absolute path of the jgroups.xml file. Then restart the repository so the changes become effective.

Log messages

In the slide.log file the following messages can be seen:

DEBUG   2007-02-17 22:58:56   [fortress.slide.jgroups-cluster]  Serviced!
DEBUG   2007-02-17 22:58:56   [fortress.slide.jgroups-cluster]  Starting!
DEBUG   2007-02-17 23:26:42   [fortress.slide.jgroups-cluster]  Started!
INFO    2007-02-17 23:33:04   [fortress.slide.jgroups-cluster]  Membership changed: [10.2.2.11:5025|4] [10.2.2.12:5025]
INFO    2007-02-17 23:33:43   [fortress.slide.jgroups-cluster]  Membership changed: [10.2.2.11:5025|5] [10.2.2.12:5025, 10.2.2.11:5025]
DEBUG   2007-02-19 08:38:50   [fortress.slide.jgroups-cluster]  Sent event! SlideEvent[type=update, namespace=default name=/files/default.preview/content/bar.xml]
DEBUG   2007-02-19 08:38:50   [fortress.slide.jgroups-cluster]  Got an event from myself!
DEBUG   2007-02-19 08:42:49   [fortress.slide.jgroups-cluster]  Got an event from: 10.2.2.11:5025
DEBUG   2007-02-19 08:42:49   [fortress.slide.jgroups-cluster]  Processing event SlideEvent[type=create, namespace=default name=/files/default.preview/content/foo.xml]