[Gluster-users] Is it ok to add a new brick with files already on it?

Franco Broi franco.broi at iongeo.com
Thu Oct 16 00:50:50 UTC 2014


I think I'm right in saying that Gluster only expects bricks to contain
similar directory structures for files on different bricks to appear to
be in the same directory from the client.

If you list a directory, Gluster will do a readdir on all the matching
directories on all the bricks, so any new files will show up. If you try
to access one of the new files directly, Gluster will try to find it
using a hash, when that fails, it will search the brick directories and
having found it, will add a link from the hash location to the actual
location.

For example:

On a client;

mkdir /data/franco/new
ls /data/franco/new
total 0

on a bricker server

touch /data5/gvol/franco/new/fred

back on client

ls -l /data/franco/new
-rw-r--r-- 1 root root 0 Oct 16 08:48 fred

On Thu, 2014-10-16 at 11:05 +1030, SINCOCK John wrote: 
> In a related question... it seems, if it is possible to add filesystems already containing data, as new bricks, then it should also be possible to:
> 
> 1) create empty bricks
> 2) add them to the gluster volume while they are empty
> 3) rsync data directly onto the underlying empty bricks, circumventing gluster, ie not through the gluster mountpoint
> 4) somehow get gluster to recognise the data that has been copied into the bricks?
> 
> How would you go about getting gluster to see the data you've rsynced directly in? 
> My concern would be that all the data rsynced directly onto the bricks will just sit there, invisible to glusterfs.
> 
> Thanks again for any info!
> 
> 
> -----Original Message-----
> From: Franco Broi [mailto:franco.broi at iongeo.com] 
> Sent: Thursday, 16 October 2014 10:06 AM
> To: SINCOCK John
> Cc: gluster-users at gluster.org
> Subject: Re: [Gluster-users] Is it ok to add a new brick with files already on it?
> 
> 
> I've never added a brick with existing files but I did start a new Gluster volume on disks that already contained data and I was able to access the files without problem. Of course the files will be out of place but the first time you access them, Gluster will add links to speed up future lookups.
> 
> On Thu, 2014-10-16 at 09:57 +1030, SINCOCK John wrote: 
> > Hi Everyone,
> > 
> >  
> > 
> > All the instructions I’ve been able to find on adding a brick to a 
> > gluster, seem to assume the brick is empty when it’s added.
> > 
> >  
> > 
> > So my question is, is it possible for a new brick, loaded up with 
> > files, to be added to a gluster (and for all the files already on that 
> > brick, to be indexed and added into the gluster). Apologies if the 
> > question is answered elsewhere, but I couldn’t find anyone addressing 
> > this specific question, and certainty helps when you’re dealing with 
> > 10’s of terabytes of data... ;-)
> > 
> >  
> > 
> > Thanks in advance for any info or tips!
> > 
> >  
> > 
> > 
> > _______________________________________________
> > Gluster-users mailing list
> > Gluster-users at gluster.org
> > http://supercolony.gluster.org/mailman/listinfo/gluster-users
> 
> 




More information about the Gluster-users mailing list