[Gluster-users] How to know (IP of GlusterServer) store a File in a GlusterFS System?
galaxmen
galaxmen at gmail.com
Mon Jul 26 12:44:01 UTC 2010
Thank you, but I have error,
After change code like your guide:
(REPLACE:
ret = dict_set_static_ptr
(dict,"trusted.glusterfs.location",priv->hostname);
BY:
ret = dict_set_str (dict, "trusted.glusterfs.location", priv->hostname);)
I rebuild (make and make install, then restart gluster)
The result changed, but I't a strange string, not the Hostname:
[root at test00/]# getfattr -n trusted.glusterfs.location /mnt/glfs/file1
getfattr: Removing leading '/' from absolute path names
# file: mnt/glfs/file1
trusted.glusterfs.location=*0sdGVzdDAxAA==*
While client is test00, servername is test01
--> Any thing error?
Amar Tumballi wrote:
> Please apply this patch, and you should be able to get info of hostname:
>
> diff --git a/xlators/storage/posix/src/posix.c
> b/xlators/storage/posix/src/posix.c
> index 0b7ab19..3275542 100644
> --- a/xlators/storage/posix/src/posix.c
> +++ b/xlators/storage/posix/src/posix.c
> @@ -3232,9 +3232,9 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
>
> if (loc->inode && S_ISREG (loc->inode->st_mode) && name &&
> (strcmp (name, "trusted.glusterfs.location") == 0)) {
> - ret = dict_set_static_ptr (dict,
> - "trusted.glusterfs.location",
> - priv->hostname);
> + ret = dict_set_str (dict,
> + "trusted.glusterfs.location",
> + priv->hostname);
> if (ret < 0) {
> gf_log (this->name, GF_LOG_WARNING,
> "could not set hostname (%s) in
> dictionary",
>
> ============================================
>
>
>
> On Tue, Jul 13, 2010 at 4:31 AM, Jeff Anderson-Lee
> <jonah at eecs.berkeley.edu>wrote:
>
>
>> On 7/9/2010 2:00 AM, Amar Tumballi wrote:
>>
>>
>>> As of now (in 3.0.x releases) there is no proper solution.. but you can
>>> try
>>>
>>> bash# getfattr -n trusted.glusterfs.location $filename
>>>
>>> which gives the hostname of the machine which contains it.. (it gives only
>>> one output even if you are using 'replicate')
>>>
>>>
>>>
>> I tried this and got nothing. In fact "getfattr -d somefilename" returned
>> nothing as well.
>>
>> Jeff Anderson-Lee
>>
>> _______________________________________________
>> Gluster-users mailing list
>> Gluster-users at gluster.org
>> http://gluster.org/cgi-bin/mailman/listinfo/gluster-users
>>
>>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Gluster-users mailing list
> Gluster-users at gluster.org
> http://gluster.org/cgi-bin/mailman/listinfo/gluster-users
>
More information about the Gluster-users
mailing list