[Gluster-users] Features - Object Count

Sachin Pandit spandit at redhat.com
Mon Jun 1 11:51:03 UTC 2015



----- Original Message -----
> From: "M S Vishwanath Bhat" <msvbhat at gmail.com>
> To: "aasenov1989" <aasenov1989 at gmail.com>
> Cc: "Gluster-users at gluster.org List" <gluster-users at gluster.org>
> Sent: Monday, June 1, 2015 3:02:08 PM
> Subject: Re: [Gluster-users] Features - Object Count
> 
> 
> 
> On 29 May 2015 at 18:11, aasenov1989 < aasenov1989 at gmail.com > wrote:
> 
> 
> 
> Hi,
> So is there a way to find how many files I have on each brick of the volume?
> I don't think gluster provides a way to exactly get the number of files in a
> brick or volume.
> 
> Sorry if my solution is very obvious. But I generally use find to get the
> number of files in a particular brick.
> 
> find /brick/path ! -path "/brick/path/.glusterfs*" | wc -l

Hi,

You can also do getfattr -d -m . -e hex <brick_path>
This command is to get the extended attributes of a directory.
When you issue this command after enabling quota then
you can see an extended attribute with name "trusted.glusterfs.quota.size"
That basically holds the size, file count and directory count.

The extended attribute consists of 48 hexadecimal numbers. First 16 will give
you the size, next 16 the file count and last 16 the directory count.

Hope this helps.

Thanks,
Sachin Pandit.


> 
> 
> Best Regards,
> Vishwanath
> 
> 
> 
> 
> 
> Regards,
> Asen Asenov
> 
> On Fri, May 29, 2015 at 3:33 PM, Atin Mukherjee < atin.mukherjee83 at gmail.com
> > wrote:
> 
> 
> 
> 
> 
> 
> Sent from Samsung Galaxy S4
> On 29 May 2015 17:59, "aasenov1989" < aasenov1989 at gmail.com > wrote:
> > 
> > Hi,
> > Thnaks for the help. I was able to retrieve number of objects for entire
> > volume. But I didn't figure out how to set quota for particular brick. I
> > have replicated volume with 2 bricks on 2 nodes:
> > Bricks:
> > Brick1: host1:/dataDir
> > Brick2: host2:/dataDir
> > Both bricks are up and files are replicated. But when I try to set quota on
> > a particular brick:
> IIUC, You won't be able to set quota at brick level as multiple bricks
> comprise a volume which is exposed to the user. Quota team can correct me if
> I am wrong.
> 
> > 
> > gluster volume quota TestVolume limit-objects /dataDir/ 9223372036854775807
> > quota command failed : Failed to get trusted.gfid attribute on path
> > /dataDir/. Reason : No such file or directory
> > please enter the path relative to the volume
> > 
> > What should be the path to brick directories relative to the volume?
> > 
> > Regards,
> > Asen Asenov
> > 
> > 
> > On Fri, May 29, 2015 at 12:35 PM, Sachin Pandit < spandit at redhat.com >
> > wrote:
> >> 
> >> ----- Original Message -----
> >> > From: "aasenov1989" < aasenov1989 at gmail.com >
> >> > To: "Humble Devassy Chirammal" < humble.devassy at gmail.com >
> >> > Cc: " Gluster-users at gluster.org List" < gluster-users at gluster.org >
> >> > Sent: Friday, May 29, 2015 12:22:43 AM
> >> > Subject: Re: [Gluster-users] Features - Object Count
> >> > 
> >> > Thanks Humble,
> >> > But as far as I understand the object count is connected with the quotas
> >> > set
> >> > per folders. What I want is to get number of files I have in entire
> >> > volume -
> >> > even when volume is distributed across multiple computers. I think the
> >> > purpose of this feature:
> >> > http://gluster.readthedocs.org/en/latest/Feature%20Planning/GlusterFS%203.7/Object%20Count/
> >> 
> >> Hi,
> >> 
> >> You are absolutely correct. You can retrieve number of files in the entire
> >> volume if you have the "limit-objects" set on the root. If "limit-objects"
> >> is set on the directory present in a mount point then it will only show
> >> the number of files and directories of that particular directory.
> >> 
> >> In your case, if you want to retrieve number of files and directories
> >> present in the entire volume then you might have to set the object limit
> >> on the root.
> >> 
> >> 
> >> Thanks,
> >> Sachin Pandit.
> >> 
> >> 
> >> > is to provide such functionality. Am I right or there is no way to
> >> > retrieve
> >> > number of files for entire volume?
> >> > 
> >> > Regards,
> >> > Asen Asenov
> >> > 
> >> > On Thu, May 28, 2015 at 8:09 PM, Humble Devassy Chirammal <
> >> > humble.devassy at gmail.com > wrote:
> >> > 
> >> > 
> >> > 
> >> > Hi Asen,
> >> > 
> >> > https://gluster.readthedocs.org/en/latest/Features/quota-object-count/ ,
> >> > hope
> >> > this helps.
> >> > 
> >> > --Humble
> >> > 
> >> > 
> >> > On Thu, May 28, 2015 at 8:38 PM, aasenov1989 < aasenov1989 at gmail.com >
> >> > wrote:
> >> > 
> >> > 
> >> > 
> >> > Hi,
> >> > I wanted to ask how to use this feature in gluster 3.7.0, as I was
> >> > unable to
> >> > find anything. How can I retrieve number of objects in volume and number
> >> > of
> >> > objects in particular brick?
> >> > 
> >> > Thanks in advance.
> >> > 
> >> > Regards,
> >> > Asen Asenov
> >> > 
> >> > _______________________________________________
> >> > Gluster-users mailing list
> >> > Gluster-users at gluster.org
> >> > http://www.gluster.org/mailman/listinfo/gluster-users
> >> > 
> >> > 
> >> > 
> >> > _______________________________________________
> >> > Gluster-users mailing list
> >> > Gluster-users at gluster.org
> >> > http://www.gluster.org/mailman/listinfo/gluster-users
> > 
> > 
> > 
> > _______________________________________________
> > Gluster-users mailing list
> > Gluster-users at gluster.org
> > http://www.gluster.org/mailman/listinfo/gluster-users
> 
> 
> 
> 
> 
> _______________________________________________
> Gluster-users mailing list
> Gluster-users at gluster.org
> http://www.gluster.org/mailman/listinfo/gluster-users
> 
> 
> _______________________________________________
> Gluster-users mailing list
> Gluster-users at gluster.org
> http://www.gluster.org/mailman/listinfo/gluster-users


More information about the Gluster-users mailing list