5

I've got multiple servers which all need to have the same content in /home. In other words, if the file /home/user1/test.txt is updated on server A, this needs to be replicated to all other servers in the cluster.

Is it possible to use GlusterFS for this purpose? That is, let each server have a full copy of all data locally - which that server will be working on - and solely use GlusterFS to take care of replicating this data to the other servers?

I'm not intersted in a combined storage, but rather have all data on all machines only to have GlusterFS to replicate it to the other machines.

sbrattla
  • 1,456
  • 3
  • 26
  • 48

1 Answers1

3

Yeah. This is pretty much a reference case for GlusterFS. One of the best things about GlusterFS is having the data stored locally, and also replicated to other cluster members. Meaning you can alternatively look it up from the Gluster Client - which gives you failover, or you can also grab the data directly off the "storage brick" location. - Good for backups.

Gluster also supports exporting volumes using NFSv3, but you don't get failover if you're using the NFS mechanism, as opposed to the FUSE-based client.

The Gluster Quick start guide should be a pretty good starting point for you.. and the administration guide has all the other answers.

That said.. GlusterFS can behave oddly if you're using it for database backend storage.. I wouldn't really want to put /var/lib/mysql on there, for example. The locks get a bit messy.

Tom O'Connor
  • 27,440
  • 10
  • 72
  • 148
  • Alright, so if i set up GlusterFS with 'replicate' and not 'distribute', then all files will remain at all nodes? I was thinking of using GlusterFS to keep files in synch between webservers, so it'll only be a question of PHP files and user uploaded content. However, it's critical that files are available locally with regards to performance. – sbrattla Nov 26 '12 at 07:13
  • ...and by the way; say i set up 10 nodes with replication. That is; a single file should always be replicated to the 9 other nodes. Is that an alright setup, or something not recommended? – sbrattla Nov 26 '12 at 07:17
  • If you set up glusterfs on replicate mode, you'll get N copies of the files across the nodes. Which might mean 1 copy per node, but also might mean M copies per N nodes. It also means that you can't add 1..N nodes, but instead your next cluster size must be 2N nodes or 3N .. – Tom O'Connor Nov 26 '12 at 08:40
  • The above behavior may have changed recently. I haven't tested it in 2-3 years – Tom O'Connor Nov 26 '12 at 08:43
  • Aha, so this then means that there is no guarantee that all files are available locally at all nodes? – sbrattla Nov 26 '12 at 08:48
  • I think you'll have to test that for any guarantee. – Tom O'Connor Nov 26 '12 at 08:52
  • Which you should do anyway. – Tom O'Connor Nov 26 '12 at 08:52