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.
On 11 April 2018 at 23:32, hannannan@xxxxxxxxxx <hannannan@xxxxxxxxxx> wrote:
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 directorybeacuse, 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 volumeusing the df command, View the space used by the volume.Display volume uses 2TB of spaceeg2: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?[root@f08n29glusterfs-3.7.20]# df -hT | grep f08n29f08n29:/usage_test fuse.glusterfs 50G 24G 27G 48% /mnt[root@f08n29glusterfs-3.7.20]# gluster volume info usage_testVolume Name: usage_testType: DistributeVolume ID: d9b5abff-9f69-41ce-80b3-3dc4ba1d77b3 Status: StartedNumber of Bricks: 1Transport-type: tcpBricks:Brick1: f08n29:/brick1Options Reconfigured:performance.readdir-ahead: on[root@f08n29glusterfs-3.7.20]# du -sh /brick1100K/brick1Is there any command that can check the actual space used by each volume in this situation?
_______________________________________________
Gluster-users mailing list
Gluster-users@xxxxxxxxxxx
http://lists.gluster.org/mailman/listinfo/gluster-users
_______________________________________________ Gluster-users mailing list Gluster-users@xxxxxxxxxxx http://lists.gluster.org/mailman/listinfo/gluster-users