[Gluster-users] unify and auto heal

Trygve Hardersen trygve at jotta.no
Fri Jun 26 17:03:46 UTC 2009


Since not all nodes in our system has a namespace directory I had to use NFS
to create the namespace files and directories from those nodes. I also did
not create directories on the bricks; these were all good on our system. So
I ended up with this slighly modified version of the script:

#!/bin/bash

# Script for restoring the namespace of a GlusterFS node
#
# By hypobyte for Jotta AS
# No rights reserved
#

MOUNT=/mnt/
NS=~/ns/
DRIVES=(data01 data02)

TOTAL_FILES=0
TOTAL_DIRS=0

# Builds the namespace for a drive
function restore() {
    echo "Restoring drive $1 to $NS"
    FILES=0
    DIRS=0
    for path in `find $1`; do
        # Remove the root  path from the filename
        file=$NS${path#*$1/}
        if test -d $path; then
            #echo "Restoring directory $path to $file"
            mkdir -p "$file"
            DIRS=$(($DIRS+1))
        else
            #echo "Restoring file $path to $file"
            touch --reference="$path" "$file"
            FILES=$(($FILES+1))
        fi
    done
    echo "Restored $FILES files and $DIRS directories from $1"
    TOTAL_FILES=$(($TOTAL_FILES+$FILES))
    TOTAL_DIRS=$(($TOTAL_DIRS+$DIRS))
}

for drive in ${DRIVES[@]}; do
    restore "$MOUNT$drive"
done

echo "Finished namespace restore of $TOTAL_FILES files and $TOTAL_DIRS
directories"

I then used the "ls -lR" command to trigger self-healing of the FS. This
copied the new namespace to the replicated namespace node, and seems to have
restored data correctly where it should. I did get a lot of these errors on
the servers during self-heal:

[2009-06-26 18:26:29] E [server-protocol.c:6387:server_setdents] server: fd
- 0 (55697410): received a null buffer, returning EINVAL

Not sure if that is something I need to worry about. AFAICT everything is
fine now.

Thanks for your help!

Trygve

On Fri, Jun 26, 2009 at 2:17 PM, Trygve Hardersen <trygve at jotta.no> wrote:

> Thanks, I'll try this.
>
> Trygve
>
>
> On Fri, Jun 26, 2009 at 2:02 PM, David Saez Padros <david at ols.es> wrote:
>
>> Hi
>>
>> In our case the unify volume appears completly empty altough the
>> disks have data, also the server log shows some lines about activating
>> auto-heal but nothing happens, so we have build a script to populate
>> the namespace, in our case we have a folder that contains a subfolder
>> named 'namespace' and 6 subfolders named 1 to 6 where each one is a
>> brick of the unify volume, then running this on the main folder
>> populates the namespace and creates appropiate folders in all bricks:
>>
>> #!/bin/bash
>>
>> for disk in 1 2 3 4 5 6 ; do
>> for file in `find $disk`; do
>>        rel=${file#*/}
>>        if test -d $file ; then
>>                mkdir -p namespace/$rel
>>                for dsk in 1 2 3 4 5 6 ; do
>>                        mkdir -p $dsk/$rel
>>                done
>>        else
>>                touch --reference=$file namespace/$rel
>>        fi
>> done
>> done
>>
>>
>>
>>  Hi
>>>
>>> We have a similar problem. Our file system became unusable for some
>>> reason. It seems to me like GlusterFS believes that files are present on
>>> some nodes when they really are not. I want to try to regenerate the
>>> namespace from the data that is actually present on the nodes.
>>>
>>> Does anyone have information about how that can be achieved? Somewhere I
>>> read that:
>>>
>>> Namespace does not hold any crucial data, it is just like a cache. Infact
>>> you can wipe our your namespace anytime and it will rebuild again.
>>>
>>> Thanks for your help
>>>
>>> Trygve Hardersen
>>> Jotta AS
>>>
>>> On Tue, Jun 23, 2009 at 12:11 PM, David Saez Padros <david at ols.es<mailto:
>>> david at ols.es>> wrote:
>>>
>>>    Hi
>>>
>>>    i have setup a unify volume using glusterfs 2.0.1 using several
>>>    disks with existing data, but once mounted in the remote client
>>>    the volume appears empty where it was suposed to auto-heal it's
>>>    contents automatically, is there any way to automatically
>>>    generate the namespace so existing data is visible to clients ?
>>>
>>>    --    Thanx & best regards ...
>>>
>>>    ----------------------------------------------------------------
>>>      David Saez Padros                http://www.ols.es
>>>      On-Line Services 2000 S.L.       telf    +34 902 50 29 75
>>>    ----------------------------------------------------------------
>>>
>>>
>>>
>>>    _______________________________________________
>>>    Gluster-users mailing list
>>>    Gluster-users at gluster.org <mailto:Gluster-users at gluster.org>
>>>    http://zresearch.com/cgi-bin/mailman/listinfo/gluster-users
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Gluster-users mailing list
>>> Gluster-users at gluster.org
>>> http://zresearch.com/cgi-bin/mailman/listinfo/gluster-users
>>>
>>
>> --
>> Salu-2 y hasta pronto ...
>>
>>
>> ----------------------------------------------------------------
>>   David Saez Padros                http://www.ols.es
>>   On-Line Services 2000 S.L.       telf    +34 902 50 29 75
>> ----------------------------------------------------------------
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://supercolony.gluster.org/pipermail/gluster-users/attachments/20090626/797f5852/attachment.html>


More information about the Gluster-users mailing list