[Gluster-devel] Re: Setting up a new AFR, but using one preexisting directory

gordan at bobich.net gordan at bobich.net
Thu May 1 09:18:22 UTC 2008


On Thu, 1 May 2008, Brandon Lamb wrote:

>>>>> I cant find the mail, I noticed it a few days ago, someone mentioned
>>>>> something about setting the file attributes to 3? Does that make
>>>>> sense?
>>>>>
>>>>> Anyway, it sounded like what may have been giving me some grief last
>>>>> time I set up a 2 server afr config. On one server I had my web data,
>>>>> and on the other i had a new blank folder. I thought by setting up
>>>>> gluster (using the existing dir on one, and a new empty dir on the
>>>>> other) that by doing the find () trick it would sync all the files,
>>>>> but is this maybe not true?
>>>>>
>>>>> I bring this up for 2 reasons, one to have it answered, and two
>>>>> because maybe this shoud be on the wiki somewhere.
>>>>>
>>>>> When setting up a new afr, should you start with 2 empty directories
>>>>> and then copy your files to the glusterfs mount, or should you do an
>>>>> rsync and then do the set attributes to 3 thing (could someone give a
>>>>> little more detail or correct my language on this?).
>>>>>
>>>>> Hopefully I am making some sense with my question, Im not totally
>>>>> clear on it myself.
>>>>>
>>>>> thanks!
>>>>
>>>> http://www.gluster.org/docs/index.php/Automatic_File_Replication_%28Mirror%29_across_Two_Storage_Servers
>>>>
>>>> Maybe this page could be worked up a little more with some information on this?
>>>>
>>>> I apologize for not knowing, Im not sure who all does the examples or
>>>> if its one person or what. Could the person(s) in charge of the
>>>> examples or maybe just this one add more to this though?
>>>>
>>>> It may seem redundant to those that are comfortable configuring the
>>>> bricks, but myself, I dont fully understand what should go where, what
>>>> order. I understand this is a hard question to answer though because
>>>> of how configurable glusterfs can be.
>>>>
>>>> So my request I guess is specific to a 2 machine, server side afr with
>>>> many clients config example(s).
>>>>
>>>> Maybe start with the basic one that is there, then add a few more
>>>> examples with how you might tune it with performance translators and
>>>> such. It would just save a little time compared to the trial and error
>>>> method.
>>>>
>>>
>>> Ok so using the setfattr -n trusted.glusterfs.version -v 3 <file/dir>
>>> command, do you need to build a script to recurvisely go through every
>>> file/folder for the given path?
>>>
>>
>> Nevermind answered my own question
>>
>> find /mnt/raid/webcluster -depth -type f -execdir setfattr -n
>> trusted.glusterfs.version -v 3 {} \; >/dev/null
>>
>
> Ok so some documentation on the implementations of doing this and what
> order and such when starting a new cluster setup probably needs to be
> put on the wiki too.
>
> I just setup my two servers, one had a 30 gig web data dir and the
> other an empty dir. I ran this command on the 30 gigs and then mounted
> on a client machine and watched it happily delete my entire web data.
> I am now at work after a mad rush here to launch our backup software
> and restore from last night.

Sounds like you re-used the glusterfs backing directory on the second 
machine that was used before. Remember, that directory has metadata 
attched, too. When you changed the source directory's version to 3, the 
other side may have had a higher version - and was empty, which meant that 
it was synced to the other side.

This was discussed on the other thread where I asked for the exact same 
thing. Your pointing it straight at live data was a tad too brave. In the 
end I concluded that the approach was just too dangerous, so I just 
mounted it as it should be and copied the files to the mount point the 
slow way.

Gordan





More information about the Gluster-devel mailing list