Glusterfs fuse client showing Stale File Handle error while copying files

3.5k Views Asked by At

I have set up my glusterfs cluster as Striped-Replicated on GCP Servers, but I am facing stale file handle error while copying files to the mounted volumes and also while doing git operations(git pull, git clone etc).

Both glusterfs server and glusterfs fuse client is using the latest version(Client-4.1.5, Server- 4.1). Please find the error messages below

While Extracting files

tar: basecode/wp-content/uploads/cache/wpml: Cannot mkdir: Stale file handle

While changing ownership

chown: cannot read directory 'www.jithin.ca/wp-content/plugins/acfml/classes': Stale file handle chown: changing ownership of 'www.jithin.ca/wp-content/plugins/advanced-custom-fields-pro': Stale file handle chown: cannot read directory 'www.jithin.ca/wp-content/plugins/wp-speed-of-light/inc/pages': Stale file handle

Also am getting below error in my glusterfs client logs file(/var/log/glusterfs/mnt-glusterfs.log)

[2018-10-21 04:08:46.921985] W [fuse-bridge.c:1201:fuse_setattr_cbk] 0-glusterfs-fuse: 3705309: SETATTR() /Production/example.com/wp-content/cache/wpsol-cache/4bd4f0bf132901ecb17261f388864fd3 => -1 (Stale file handle)

Also, my glusterfs server is using default settings. Please help if there is any patches or fix.

1

There are 1 best solutions below

0
On

First: don't place the WP cache on GlusterFS.

The WP on each node in a cluster will write to the cache folder at the same time and it may cause some problems. Try to point the WP to a cache directory outside GlusterFS (/wp-cache, for instance). I'm not very familiar with WP and can't give you an appropriate config option. Or just create a symlink inside basecode/wp-content/uploads/ to your new cache directory.

Second: some people say that a striped volume works very bad and there isn't an answer why.

Try to use a distributed replicated volume instead or, maybe, a dispersed volume.

Third: you can use the striped volume and can play with some mount/GlusterFS options but, I think, that is a bad approach.

The first options for playing - entry-timeout and attribute-timeout, which are described here http://systutorials.com/docs/linux/man/8-mount.glusterfs. If you set them to 0 you can disable an attribute cache. This can help you with the Stale file handle error but performance will be very low (in some cases). More information about Attribute caching here: https://linux.die.net/man/5/nfs.