Running two MySQL servers that use the same data directory

  1. Since the documentation tells you exactly what precautions to take, I was expecting this to actually work...or else, what's the point of that guide in the official documentation? If this couldn't be done, why would it tell you how to do it in the first place?

  2. Most importantly, do you know how to make this work, using MySQL?

You said something that might have a bearing on the first two question

Both MySQL instances access the same data directory, which is stored on a persistent volume (this volume is provided by Gluster, but that's not really relevant, I'm only saying this for the sake of completeness).

Interestingly, someone has claimed to have pulled this off.

On Sep 24, 2010 (nearly either years ago), Richard Holloway answered a question he himself posted in Server Fault : Can I run mysqld on top of glusterfs?

Quoting Richard Holloway's answer

  • Disable the query cache (Set query_cache_type=0, query_cache_size=0)
  • Switch on external locking
    • Richard cites MySQL 5.1 Doc on external locking
    • Michael - sqlbot just recommended 5.6 Doc in his comment.
  • disable delays to writing.

This is a very daring answer ( Godspeed, Spiderman !!! )

Just to throw in my 2 cents

  • Do not use GlusterFS in async mode !!!
  • Configure skip-innodb on both mysqld instances
  1. If not, do you know of any other DBMSs that allow you to obtain this result (that is, running two servers that use the same data directory)?

The answer is Oracle RAC. It is designed to operate multiple Oracle instances sharing only one set of datafiles. Each instance has its own log buffer. Oh yeah, you will need boat loads of money (Oracle RAC is not open source).

Tags:

Mysql

Dbms