gluster/glusterfs

not able to configure with non root user

sachinbanugariya opened this issue · 9 comments

hello,
i am able to configure glusterfs with root user and all things are working fine.

but there is issue which i need to solve:
at client side i have one directory which having permission of non root user and which files add on that folder is also came with same non root user.

so after replication on server side file permission is changed with non root to 1001 like that.
we want to replicate all client data as it is without change of file permission.

so please can you explain where is the issue and how can i get pure replication as it is with same as client side, with same permission.

maybe i think that is because of glustefs configuration using root user,
so how can i configure glusterfs with non-root user, i tried but getting below error when i try to mount client side with non root user:
/usr/bin/fusermount-glusterfs: mount failed: Operation not permitted

hope i will getting reply ASAP.
thanks.

thotz commented

Actually I didn't understand ur issue completely. If you are disperse/replicated(not jbr) volume the directory created from client side, it should perform parallelly on all the servers. can share the volume info of ur volumes.

we want nginx permission everywhere on client side as well as server side.

suppose at client side our directory data is created and given permission of nginx user then mount that directory with server,

so when new files are added at client side data directory which is with permission of nginx user,
so we want that file replicated at server side with same nginx user permission.

thanks

also just i want to know how can i mount my client side data directory with nginx user??

using sudo -u nginx mount xxxx...
it gives this error
/usr/bin/fusermount-glusterfs: mount failed: Operation not permitted

Volume Name: test
Type: Replicate
Volume ID: 76bdbxxx-3358-4aad-xxxe-xxx3447ea0db
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: 95.xxx.10.xx:/data
Brick2: 95.xxx.10.xx:/data
Options Reconfigured:
auth.allow: 62.xxx.69.xx
transport.address-family: inet
nfs.disable: on

above is my volume info,
thanks.

thotz commented

IMO following should work,

at client side

mount the volume using root.
change the owner and group of "mount point" to nginx

make sure uid of nginx is same across clients/servers

at server side

check whether owner/group of brick path changed accordingly

Then from client side if u create file using nginx user then mount point then it will owner will nginx only

ok permission issue is seems because of different UID and GID,
thanks.

but how can i check>>
check whether owner/group of brick path changed accordingly ???

Check at the backend directly(do ls on brick path)

and also want to know how can i mount using nginx user ??

Currently it looks like limitation with gluster, do u really need it?

Jiffin
thanks

Currently it looks like limitation with gluster, do u really need it?

if possible then need,
otherwise its ok, i will able to manage now.
thanks.

thotz commented

I have open upstream bug for this issue(cloned from RHGS). Hence closing this issue

thotz commented

Sorry the bug is not valid in glusterfs(seen only in RHGS).
I tried the following (mentioned in https://joejulian.name/blog/mounting-a-glusterfs-volume-as-an-unprivileged-user/) using glusterfs 3.12 it works fine.

On a server:

gluster volume set $VOLUME allow-insecure on

On the client as root:

echo user_allow_other >> /etc/fuse.conf

To mount the volume, you can:

/usr/sbin/glusterfs --log-level=INFO --log-file=my_user_accessable_logfile.log --volfile-id=$VOLUME --volfile-server=$SERVER $MOUNTPOINT

or

use sudo mount command