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.

I am using 64bit CentOS 5.5

I know it's possible to set up software RAID1 using mdadm using a physical hard disk and a RAM disk.

Is it possible to set up software RAID1 with mdadm using a NFS mount and a RAM disk instead?

Or another way to put the question, is it possible for a NFS mount to be a block device that works with mdadm?

I plan to use the --write-mostly option so that the reads are done from the RAM disk.

OK, here's the why.

I need a synchronous shared filesystem for my web cluster as Apache is performing writes.

I have tried GlusterFS but the peformance on dynamic pages that require many small files to be read is unacceptable. It takes 5 seconds to create one of the dynamic signup pages on my site for example. It's my understanding that small file performance is a problem with any shared/clustered filesystem to varying degrees. Correct me if I'm wrong.

Since nothing is going to be faster than RAM, hence the question about software RAID1 using a ram drive and a NFS mount.

This way, I'll get the speed of RAM and the synchronous replication I need on the writes.

share|improve this question
add comment

3 Answers

Nope. The gold standard in this space would be DRBD, which you can then use to build filesystems on.

There are some design patterns around using it with GFS to build clustered, replicated filesystems on commodity hardware.

share|improve this answer
1  
How about GNBD? –  Travis Jul 18 '10 at 14:53
add comment

No, you need block level access such as xATA/SAS/FC/FCoE/iSCSI disks.

share|improve this answer
    
I just discovered the Network Block Device. linuxjournal.com/article/3778 "A network block device (NBD) driver makes a remote resource look like a local device in Linux, allowing a cheap and safe real-time mirror to be constructed." This is available in my kernel, so I'm assuming this will work? –  Travis Jul 17 '10 at 20:28
    
After much more Googling, I'm thinking iSCSI formatted with gfs2 is the way 2 go. Then I can software RAID1 iSCSI to a local device which will give the performance and replication I need. Any additional comments/suggestions would be appreciated. –  Travis Jul 18 '10 at 16:55
    
I really don't think that will work or give your the performance you think it might. –  Chopper3 Jul 18 '10 at 20:11
    
After some more thought, I agree, it won't work. So how do I keep a fileserver and each webserver's RAM drives in sync? I've looked at realtime two way synchronization for linux but I can't find anything. –  Travis Jul 19 '10 at 9:05
1  
Sorry, can you clarify exactly what it is you wish to achieve please –  Chopper3 Jul 19 '10 at 10:18
add comment

DOH, I can't reply to you Chopper3 in the above thread so I'm doing it here.

Don't know why it didn't work this time.

Thank you for your help. I used a combination of lsyncd, inotifywait with a two way synchronization tool (Synchronex) for the directories the web server makes changes with, to always have the GlusterFS and each RAM drive on each web server in sync.

So in short, I wanted a RAM drive for each webserver that was a copy of the clustered file system for performance. But any writes to any of the webserver's RAM drive by Apache is replicated to the clustered filesystem and the other webserver's RAM drive.

share|improve this answer
add comment

Your Answer

 
discard

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