6.1. Setting up eXo Platform cluster

Note

In eXo Platform 4.0.x, cluster mode is supported for JBoss only. This guideline is not usable for Tomcat.

Setting up eXo Platform clustering

  1. Install your Platform JBoss package by following steps in Installing JBoss EAP.

  2. Create a copy of the package for each cluster node. It is assumed that you have 2 available hosts: node1.your-domain.com (here node1 will be executed) and node2.your-domain.com (here node2 will be executed). You need to place a copy of the package in node1, and another copy in node2.

  3. Configure both packages to use the same database by following instructions in the Database chapter.

    Note

    According to instructions in Database, you will need to edit the standalone-exo.xml file. However, in the cluster mode, you should edit standalone-exo-cluster.xml or any file that you set in the start command: --server-config=standalone-exo-cluster.xml.

  4. Share a folder on the network that can be accessed from 2 nodes (depending on your operating system).

    Assuming that the folder's path is: /mnt/nfs/shared/data, edit the system property exo.shared.dir in the standalone-exo-cluster.xml file:

    
    <system-properties>
        ...
        <property name="exo.shared.dir" value="/mnt/nfs/shared/data"/>
        ...
    </system-properties>
  5. Edit the $PLATFORM_JBOSS_HOME/bin/standalone-customize.conf file by adding the following line:

    In node1:

    JAVA_OPTS="${JAVA_OPTS} -Djgroups.tcpping.initial_hosts=node1.your-domain.com[7800],node2.your-domain.com[7800] -Djgroups.tcpping.num_initial_members=2 -Djboss.node.name=node1"

    In node2:

    JAVA_OPTS="${JAVA_OPTS} -Djgroups.tcpping.initial_hosts=node1.your-domain.com[7800],node2.your-domain.com[7800] -Djgroups.tcpping.num_initial_members=2 -Djboss.node.name=node2"

    The -Djgroups.tcpping.initial_hosts parameter is a comma-separated list of nodes. Each node should be represented by its FQDN (or IP) and a port. The port must match the TCP start_port that is configured in the standalone/configuration/gatein/jgroups/jgroups-tcp.xml file:

    
    <TCP
        ...
        start_port="${jgroups.tcp.start_port:7800}"
        ... />

    You can either edit the 7800 value directly or set the system property jgroups.tcp.start_port (via start command or the server configuration file - standalone-exo-cluster.xml as explained before).

  6. Run the servers:

    • Start node1 from its $PLATFORM_JBOSS_HOME/bin directory:

      ./standalone.sh -b 0.0.0.0 --server-config=standalone-exo-cluster.xml
    • Start node2 from its $PLATFORM_JBOSS_HOME/bin by the same command:

      ./standalone.sh -b 0.0.0.0 --server-config=standalone-exo-cluster.xml

    The command is used on Linux. On Windows, just replace standalone.sh with standalone.bat.

Some additional notes

After completing the steps above, you can access the application via host name / ip address of each node:

To configure a front-end for your nodes, follow Setting up Apache front-end.

To configure load balancing, follow Setting up mod_jk.

See also

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus