Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Can SilverStripe work with MySQL multimaster replication?


Go to End


6 Posts   2638 Views

Avatar
silverhawk

Community Member, 5 Posts

13 July 2008 at 1:10pm

Hi everybody, this is my first post in forums. I have a question, and maybe someone could help me. Can SilverStripe work with MySQL multimaster replication? MySQL allows replicate several copies of same database in "circular" way (master/master). To prevent a primary key value "collision", MySQL has two parameters to avoid this ('auto_increment_offset' and 'auto_increment_increment'). Happily, all SilverStripe tables has primary keys configured as "autoincremental" (very few CMS have this feature). Therefore, if each MySQL server is properly configured, no primary key collision should be occurs. However, i'm not sure this is enough to conclude that a SilverStripe installation replicated in several MySQL servers will works safely. The idea is use a LVS director to assign connections (with persistance) to several Lighttpd servers, each connected to a different replicated MySQL database. Someone knows if this is possible? Thanks in advance!

Avatar
Sam

Administrator, 690 Posts

14 July 2008 at 3:49pm

Hi silverhawk,

I can think of no reason why it wouldn't work in such an environment, but we've never tested it ourselves. I can confirm that SilverStripe respects the offset/increment settings that you've listed.

I would say that it is sufficiently likely to work to warrant experimentation, so I suggest that you set up a site and let us know how you get on!

Avatar
silverhawk

Community Member, 5 Posts

15 July 2008 at 3:45am

Hi Sam, thanks for your quick reply. I will try to prepare a test installation this week and then post results. Thanks again!

Avatar
silverhawk

Community Member, 5 Posts

24 July 2008 at 9:16am

Edited: 24/07/2008 9:20am

Hi, finally I prepare an environment to test multimaster replication with SilverStripe. I create 6 virtual machines (with VirtualBox 1.6.0). Every VM have Debian 5.0 (Lenny) Beta 2 installed (with kernel 2.6.24-1-686).
Clients and servers reside in separated private networks. Clients connect to a LVS director (version 1.24, ipvsadm --version).
The LVS director expose a virtual IP 10.0.0.99 via NAT mode, with persistance. The three real servers have installed Lighttpd 1.4.19 (with rewriting rules), and MySQL 5.0.51 (configured with multimaster replication). The three machines have SilverStripe 2.2.2 sources deployed in web server root directory (/var/www in Debian) and a empty database created in each MySQL server.
I use one client (192.168.0.2) to install SilverStripe through virtual IP (http://10.0.0.99/install.php). LVS assign this connection to one real server and installation begins. After installation, I have three exactly copies of SilverStripe database (both structure and data) and could edit content from client without problems.
After, I use rsync 3.0.3 to sinchronize web server root directory to other webservers (and create /var/www/mysite/_config.php).
Later, I test connection of a client to a different web server (and to a replicated database) and SilverStripe works smoothly.
At first glance, everything looks ok, but much more testing are needed, specially in concurrent edit situations and data caché utilization.
Best regards.

Avatar
silverhawk

Community Member, 5 Posts

24 July 2008 at 9:22am

Attached to this post is an ASCII diagram of network configuration used in test.

Avatar
silverhawk

Community Member, 5 Posts

24 July 2008 at 9:24am

Oops, i forgot upload file :)