[Gluster-users] about tail command

Anuradha Talur atalur at redhat.com
Wed Mar 2 07:22:35 UTC 2016

----- Original Message -----
> From: "songxin" <songxin_1980 at 126.com>
> To: "gluster-user" <gluster-users at gluster.org>
> Sent: Tuesday, March 1, 2016 7:19:23 PM
> Subject: [Gluster-users] about tail command
> Hi,
> recondition:
> A node:
> B node:
> brick on A node:/data/brick/gv0
> brick on B node:/data/brick/gv0
> reproduce steps:
> 1.gluster peer probe (on A node)
> 2. gluster volume create gv0 replica 2
> force (on A node)
> 3.gluster volume start gv0 (on A node)
> 4. mount -t glusterfs gluster (on A node)
> 5.create some files (a,b,c) in dir gluster (on A node)
> 6.shutdown the B node
> 7.change the files (a,b,c) in dir gluster (on A node)
> 8.reboot B node
> 9.start glusterd on B node but glusterfsd is offline (on B node)
> 10. gluster volume remove-brick gv0 replica 1
> force (on A node)
> 11. gluster volume add-brick gv0 replica 2
> force (on A node)
> Now the files are not same between two brick
> 12." gluster volume heal gv0 info " show entry num is 0 (on A node)
> Now What I should do if I want to sync file(a,b,c) on two brick?
Currently, once you add a brick to a cluster, files won't sync automatically.
Patch has been sent to handle this requirement. Auto-heal will be available soon.

You could kill the newly added brick and perform the following operations from mount
for the sync to start :
1) create a directory <dirname>
2) setfattr -n "user.dirname" -v "value" <dirname>
3) delete the directory <dirname>

Once these steps are done, start the killed brick. self-heal-daemon will heal the files.

But, for the case you have mentioned, why are you removing brick and using add-brick again?
Is it because you don't want to change the brick-path?

You could use "replace-brick" command.
gluster v replace-brick <volname> <hostname:old-brick-path> <hostname:new-brick-path>
Note that source and destination should be different for this command to work.

> I know the "heal full" can work , but I think the command take too long time.
> So I run "tail -n 1 file" to all file on A node, but some files are sync but
> some files are not.
> My question is below:
> 1.Why the tail can't sync all files?
Did you run the tail command on mount point or from the backend (bricks)?
If you run from bricks, sync won't happen. Was client-side healing on?
To check if they were on or off, run `gluster v get volname all | grep self-heal`, cluster.metadata-self-heal, cluster.data-self-heal, cluster.entry-self-heal should be on.

> 2.Can the command "tail -n 1 filename" trigger selfheal, just like "ls -l
> filename"?
> Thanks,
> Xin
> _______________________________________________
> 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