2

On a storage node, GlusterFS bricks (the physical disks composing a GlusterFS volume) are typically mounted at a specific location. For example: /export/glusterfs/<volume>/brick0/brick.

However to use a GlusterFS volume, it must be mounted:

mount -t glusterfs gluster.example.com:/<volume> /mnt

Now I can change all the files in /mnt and GlusterFS will do its magic. However, we can also see the same files in /export/glusterfs/<volume>/brick0/brick.

Can the files in /export/glusterfs/<volume>/brick0/brick be changed without breaking GlusterFS?

Spack
  • 1,604
  • 15
  • 22

2 Answers2

3

Yes, technically you can modify files in the underling volume, but Gluster will not be notified about your changes, and therefore they may not be replicated to other Gluster nodes.

This is very much not recommended, and could mean that your servers end up with different underlying files, which can lead to unpredictable behaviour/data loss.

JamesHannah
  • 1,731
  • 2
  • 11
  • 24
0

Once I have several files copied directly to the brick, is there any way to make Gluster be aware about those new files?

  • The bricks should not be used directly. They are managed by GlusterFS. It is best to mount the Gluster volume and then copy the files. – Spack Oct 19 '22 at 16:07
  • Yes, I know. Just asking in case accidentally someone copy data directly to the brick. – Danilo Mussolini Oct 20 '22 at 18:02
  • @DaniloMussolini I had done this exact mistake without realizing I have mounted the brick path directly and not the glusterfs. I had to mount the glusterfs path, and touch each file (I used `chwon -R`) so that gluster gets the file change notifications, and the files appeared on other peers as well. – Adarsha May 08 '23 at 02:56