Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

3 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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)

share|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 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 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 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 at 20:46
    
Caching is automatic when using the kernel module. ceph.com/docs/next/rbd/rbd-config-ref –  Matt Jun 23 at 21:43
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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