We have a database cluster that uses MySQL on DRBD with Pacemaker+Corosync, which is great. My question is whether it is possible (and whether anyone has been successful) to mount a CephFS drive to /var/lib/mysql and run MySQL from there.

The advantage would be that MySQL could then run on any cluster node, without the 2 node constraint of DRBD (or worse, the complexity of DRBD on DRBD).


Yes, it will work but you can't run more then one mysql instance same time.

Better just use mysql master-master replication WITHOUT drbd, put one failover ip(probably from network) and use mysql_proxy project to put all write on one mysql(failover ip) and spread read to multiple. That will work excelent and will not have issues of mysql master-master setup becuase only one node do writes.

| improve this answer | |

If its a solution for mysql cluster that you are looking for, you should take a look at galera, which offers an easy way of multi master replication. You should have at least three nodes though.

| improve this answer | |

No. I wish you could. Unfortunately you can't have multiple mysql servers accessing the same data files. Mysql doesn't cope with it and you'll probably just get corrupted.

You can however place the mysql data onto cephfs with a single mysql instance, that does work as does RBD.

(yeah I know an old question, but I wanted to do this and found out that you can't. The answers were not entirely clear)

| improve this answer | |
  • Are you saying that it's possible to use a single MySQL master on the CephFS, but all the slaves are not on CephFS but are on their own isolated storage? What about master to master replication? What if you create multiple directories in CephFS and you ran each master from a different directory? – CMCDragonkai Jun 20 '14 at 4:52
  • CMCDragonkai, that should work if the data files are different for each instance. And if your cephfs is served from something fast like IPoIB (Infiniband) or bonded 10Gbe you should get quite decent performance. – Matt Jun 23 '14 at 3:11
  • I read there was a writeback cache allowing immediate awks for any write. This way the multi master setup will handle their own replication at a database level, and ceph will just replicate on their own and I don't have to worry too much about a fast connection. What do you think? (Also how does Ceph handle eventual consistency with the writeback cache?) – CMCDragonkai Jun 23 '14 at 4:04
  • That cache is with rbd. I'm actually using rbd disks instead of cephfs for my mysql data files. I'd recommend rbd over cephfs in this setup because cephfs still isn't as well tested as rbd I've managed to corrupt my cephfs instance before. – Matt Jun 23 '14 at 20:46
  • Caching is automatic when using the kernel module. ceph.com/docs/next/rbd/rbd-config-ref – Matt Jun 23 '14 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.