Discussion:
[Gluster-users] how to get the true used capacity of the volume
h***@shudun.com
2018-04-12 03:32:47 UTC
Permalink
I create a volume£¬and mounted it, and use df command to view the volume Available and used .
After some testing£¬ I think the used information displayed by df is the sum of the capacities of the disks on which the brick is located.
Not the sum of the used of the brick directory.
£šI know the Available capacity, is the physical space of all disks if not quota£¬
but used of space should not be sum of the space used by the hard disk, should be the sum of the size of the brick directory
beacuse, There may be different volumes of bricks on one disk£©

In my case£º
I want to create multiple volumes on some disks£šFor better performance, each volume will use all disks of our server cluster£©£¬one volume for NFS and replica 2£¬one volume for NFS and replica 3£¬ one volume for SAMBA¡£
I want get the capacity already used of each volume, but now one of the volumes write data, the other volumes used will also increase when viewed using df command.

Example:
eg1:
I create a volume with two bricks and the two bricks are on one disk. And write 1TB of data for the volume
using the df command, View the space used by the volume.
Display volume uses 2TB of space

eg2:
such as £ºWhen I create a volume on the root partition£¬I didn't write any data to the volume£¬But using df shows that this volume has used some space¡£
In fact, these spaces are not the size of the brick directory, but the size of the disk on which the brick is located.

How do I get the capacity of each volume in this case?

[***@f08n29glusterfs-3.7.20]# df -hT | grep f08n29
f08n29:/usage_test fuse.glusterfs 50G 24G 27G 48% /mnt

[***@f08n29glusterfs-3.7.20]# gluster volume info usage_test
Volume Name: usage_test
Type: Distribute
Volume ID: d9b5abff-9f69-41ce-80b3-3dc4ba1d77b3
Status: Started
Number of Bricks: 1
Transport-type: tcp
Bricks:
Brick1: f08n29:/brick1
Options Reconfigured:
performance.readdir-ahead: on

[***@f08n29glusterfs-3.7.20]# du -sh /brick1
100K/brick1

Is there any command that can check the actual space used by each volume in this situation?
Alastair Neil
2018-04-13 17:11:08 UTC
Permalink
You will get weird results like these if you put two bricks on a single
filesystem. In use case one (presumably replica 2) the data gets written
to both bricks, which means there are two copies on the disk and so twice
the disk space consumed. In the second case there is some overhead
involved in creating a volume that will consume some disk space even absent
any user data added, how much will depend on the factors like the block
size you used to create the filesystem.

Best practice is that each brick should be on it's own block device with
it's own filesystem and not shared with other bricks or applications. If
you must share physical devices then use lvm (or partitions - but lvm is
more flexible) to create separate volumes each with it's own filesystem for
each brick.
I create a volumeand mounted it, and use df command to view the volume
Available and used .
After some testing I think the used information displayed by df is the
sum of the capacities of the disks on which the brick is located.
Not the sum of the used of the brick directory.
I know the Available capacity, is the physical space of all disks if not
quota
but used of space should not be sum of the space used by the hard disk,
should be the sum of the size of the brick directory
beacuse, There may be different volumes of bricks on one disk
In my case
I want to create multiple volumes on some disksFor better performance,
each volume will use all disks of our server clusterone volume for NFS
and replica 2one volume for NFS and replica 3 one volume for SAMBA。
I want get the capacity already used of each volume, but now one of the
volumes write data, the other volumes used will also increase when viewed
using df command.
I create a volume with two bricks and the two bricks are on one disk. And
write 1TB of data for the volume
using the df command, View the space used by the volume.
Display volume uses 2TB of space
such as When I create a volume on the root partitionI didn't write any
data to the volumeBut using df shows that this volume has used some space。
In fact, these spaces are not the size of the brick directory, but the
size of the disk on which the brick is located.
How do I get the capacity of each volume in this case?
*f08n29:/usage_test fuse.glusterfs 50G 24G 27G 48% /mnt*
Volume Name: usage_test
Type: Distribute
Volume ID: d9b5abff-9f69-41ce-80b3-3dc4ba1d77b3
Status: Started
Number of Bricks: 1
Transport-type: tcp
*Brick1: f08n29:/brick1*
performance.readdir-ahead: on
*100K/brick1*
Is there any command that can check the actual space used by each volume
in this situation?
_______________________________________________
Gluster-users mailing list
http://lists.gluster.org/mailman/listinfo/gluster-users
Loading...