Wiki source code of Clustering

Last modified by Thomas Mortagne on 2023/02/01

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
5 XWiki provides an easy way to setup clustered instances of XWiki based on network events distribution.
7 = Features =
9 * events synchronization between XWiki instances
10 * multiple clustering channels
11 * possibility to start/stop the clustering channel at runtime
13 = Setup =
15 == Use a remote Solr instance ==
17 XWiki store a lot of information in Solr cores so like with the database you will need to make sure that all cluster members use the same Solr instance remotely instead of each having its own embedded instance.
19 See for more details about the remote solr setup.
21 == Enable event distribution ==
23 To enable event distribution in an XWiki instance go to file and set the property ##observation.remote.enabled## to ##true##.
25 == Setup communication channels ==
27 You will need a configuration file for each different cluster group you want to setup. Generally there is only one for a simple cluster.
29 For this you can either:
31 * use one of the files provided by jgroups ("tcp", "udp", etc. it's generally enough for most use cases and certainly a lot simpler) which can be customized through system properties
32 * create your own configuration file
34 === Created your own configuration file ===
36 For this go to the ##/WEB-INF/observation/remote/jgroups## folder and add one xml file.
38 See [[JGroups documentation>>]] for more details on how to setup JGroups configuration files.
40 If you have IPv6 on your server, you are also advised to read [[this IPv6 article>>]]. Defining when launching the JVM is probably your best bet in most cases. If your really want to use IPv6 for your channels, you should probably upgrade JGroup to version 2.10.0.GA and use a JVM 6 at least.
42 == Start communication channels ==
44 The name of the xml file matches the identifier of the channel.
46 To indicate which channels to start when XWiki starts list them in the property ##observation.remote.channels## of the file.
48 == Choose network adaptor implementation to use ==
50 By default only JGroups implementation is provided, but it's possible to add more. See the [[Remote Observation Module>>extensions:Extension.Observation Module Remote#HAddcustomnetworkadaptor]] for more details.
52 = Limitations =
54 The following limitations currently exist when you use clustering:
56 * [[XWIKI-6235>>]]: The Scheduler feature is not cluster-aware and thus each node of XWiki runs its own scheduler and thus the same scheduler jobs will execute on all nodes. The workaround is to disable the Scheduler plugin on all nodes except on one. Note that this creates a [[SPOF>>]]
57 * [[XWIKI-14722>>]]: Attachments and deleted documents located on the file system (located inside the [[Permanent Directory>>Documentation.AdminGuide.Configuration.WebHome#HPermanentDirectory]]) are currently not clustered and in order for all XWiki instance to access and display them properly in the UI, you'll need to set up shared filesystem and share the ##store/file## directory. Note that you must not share the whole Permanent Directory or this will lead to problems (such as causing file contentions when several instances try to read/write to some of them which have locks on).
58 * [[XWIKI-11441>>]] If a node is down and events happen, these events won't be propagated to the node when it comes back up. For example, imagine you install an extension on a node of the cluster while another node is down. When that node is restarted, the extension won't be installed on it.
60 = Performances =
62 * You may want to [[configure SOLR to use an external SOLR instance>>xwiki:Documentation.AdminGuide.Performances.WebHome||anchor="HStandaloneSolr"]] instead of having each node maintain its own SOLR index (even though that would work fine but you'd be less performant since each node would do the same work)
63 * See [[general performance page>>Documentation.AdminGuide.Performances]] for more ideas.
65 = More =
67 See the [[Remote Observation Module>>extensions:Extension.Observation Module Remote]] for more details of the event distribution features and extension capabilities.
69 Follow the [[test clustering tutorial>>Documentation.AdminGuide.Clustering.DistributedEventClusterSetup.WebHome]] for a complete tutorial on how to setup a simple cluster between two instances of XWiki on the same server.

Get Connected