4

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).

Bryan Agee
  • 1,179
  • 2
  • 10
  • 27

3 Answers3

2

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 10.0.0.0 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.

arheops
  • 708
  • 1
  • 5
  • 13
2

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.

Isaac
  • 1,195
  • 3
  • 25
  • 43
1

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)

hookenz
  • 14,132
  • 22
  • 86
  • 142
  • 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 04: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. – hookenz Jun 23 '14 at 03: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 04: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. – hookenz Jun 23 '14 at 20:46
  • Caching is automatic when using the kernel module. http://ceph.com/docs/next/rbd/rbd-config-ref – hookenz Jun 23 '14 at 21:43
  • What exactly is the difference between cephfs and rbd? Also do you have any ideas regarding eventual consistency as per my previous comment? – CMCDragonkai Jun 24 '14 at 01:44
  • It might be better to ask these questions in another question rather than carry on a conversation in comment. – hookenz Jun 24 '14 at 02:23