JGroups advanced configuration

Question

Configure JGroups stack for advanced configuration

Solution

To configure JGroups stack to match your needs, you need to adapt the tcp.xml file from Jahia and deploy on your platform. Then you will need to update your jahia.properties to define the location of the file.

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="urn:org:jgroups">
    <TCP
         bind_port="${cluster.tcp.bindPort:7870}"
         port_range="0"
         singleton_name="tcp-jahia-shared"
         loopback="false"
         recv_buf_size="${tcp.recv_buf_size:5M}"
         send_buf_size="${tcp.send_buf_size:640K}"
         max_bundle_size="64K"
         max_bundle_timeout="30"
         use_send_queues="true"
         sock_conn_timeout="300"
         enable_diagnostics="${jahia.jgroups.enable_diagnostics:false}"
         diagnostics_addr="${jahia.jgroups.diagnostics_addr:224.0.75.75}"
         diagnostics_port="${jahia.jgroups.diagnostics_port:7500}"
         timer_type="new3"
         timer.min_threads="4"
         timer.max_threads="10"
         timer.keep_alive_time="3000"
         timer.queue_max_size="500"
         thread_pool.enabled="true"
         thread_pool.min_threads="1"
         thread_pool.max_threads="10"
         thread_pool.keep_alive_time="5000"
         thread_pool.queue_enabled="false"
         thread_pool.queue_max_size="100"
         thread_pool.rejection_policy="discard"
         oob_thread_pool.enabled="true"
         oob_thread_pool.min_threads="1"
         oob_thread_pool.max_threads="8"
         oob_thread_pool.keep_alive_time="5000"
         oob_thread_pool.queue_enabled="false"
         oob_thread_pool.queue_max_size="100"
         oob_thread_pool.rejection_policy="discard"/>
    <JAHIA_JDBC_PING datasource_jndi_name="java:comp/env/jdbc/jahia" initialize_sql=""/>
    <MERGE2  min_interval="10000"
             max_interval="30000"/>
    <FD_SOCK/>
    <FD timeout="3000" max_tries="3" />
    <VERIFY_SUSPECT timeout="1500"  />
    <pbcast.NAKACK2 use_mcast_xmit="false"
                   discard_delivered_msgs="true"/>
    <UNICAST3 />
    <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
                   max_bytes="4M"/>
    <pbcast.GMS print_local_addr="true" join_timeout="3000"
                view_bundling="true"/>
    <MFC max_credits="2M"
         min_threshold="0.4"/>
    <FRAG2 frag_size="60K"  />
</config> 
And here's the property name that you need to define in jahia.properties:
 
cluster.configFile.jahia=/etc/jahia/cluster/my-tcp.xml 

To find more about how to configure and the list of protocols (For example if you need to add security layers)
http://www.jgroups.org/manual3/index.html#protlist