Hi Alessandro,
Hello there.
I am trying to setup a master to master replication with mysql and xwiki. The replication
on his side works well.
But now when master1 creates a file it will be created on master2 same goes with changes
in document and history version goes up and up.
But when i have for example version 2.1 at a document and i want to change it on master2
and look it up on master1 there no change, but i replicated the newer version but is still
on 2.1 not 3.1 as it should be. The problem now is that when i click rollback to get
content of version 3.1 it does a version 4.1 which dont gets replicated. So whole
replication stops and its like 2 xwiki from there on.
Do you have an idea for settings auto-use newest version? I didnt found something like
that.
Or do you have some others ideas for that.
Thank you very much
Best regards Alessandro
I am not sure if I understand your problem correctly, but I think you run into problems
with the hibernate cache, which caches SQL-results on the application level.
Before going into details, check if you have followed the steps here:
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Clustering
Note that this is a documentation for an XWiki application cluster with a single database.
I think these steps will be sufficient for a system with a master-master setup, too.
Also there is a "permanent Directory" for each the XWiki instace that should
kept in sync;
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HOtherconsi…
at least the "extensions" directory should be shared or kept in sync otherwise,
even if you do not store attachments ion the file system.
To analyse your problem, please install the Admin Tools:
http://extensions.xwiki.org/xwiki/bin/view/Extension/Admin+Tools+Application
This contains a "Flush Cache" page.
If you change a page and this change does not show up on the other server, can you please
try to flush the cache on that other server and see if the changes become visible?
If this does not make the problem go away for a moment, then the source of problem is
somewhere else and I am left in the dark about the issue.
If it indeed does fix the issue momentarily, you might want to set up the cluster as
described above. This should fix the problem.
If the problem still persists, you can check with the WEB-INF/hibernate.xml and try to
configure a distributed hibernate cache.
I remember I have done something like that for another application some time ago with
ehcache, but cannot find the documentation; I guess it was something like:
http://ehcache.org/documentation/2.8/hibernate/index
But then I think the "official" way to set up the cluster is broken and should
be fixed instead of admins having to mess with integrating ehcache.
Some other idea:
If you need high availability and it is ok to have one of the databases mostly as
fallback, maybe configuring the JDBC-connection to use one DB as the main DB and the other
as fallback is acceptable, too
In that case there is a little less to worry about the master-master replication
crashing.
Reference docs about that is here:
http://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration…
Even with this solution, you still should set up your XWiki servers in cluster mode.)
hope this helps,
Clemens