[Gluster-devel] Selectively setting loglevel for logs from an xlator

Raghavendra Gowdappa rgowdapp at redhat.com
Thu Jan 12 10:59:04 UTC 2017


All,

Not sure many of us know about how to selectively set log-level of an xlator. Thought this might be helpful to someone.

To selectively set log-level of an xlator we need to do setfattr on any path in glusterfs with "trusted.glusterfs.%s.set-log-level" (where %s is name of xlator in xlator graph) as key and log-level as value. For eg.,

[root at unused glusterfs]# gluster volume info
 
Volume Name: r2
Type: Distributed-Replicate
Volume ID: ff216e89-23a0-4b1e-9cf6-5f3bceea68bf
Status: Started
Snapshot Count: 0
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: localhost.localdomain:/home/gfs/r2_0
Brick2: localhost.localdomain:/home/gfs/r2_1
Brick3: localhost.localdomain:/home/gfs/r2_2
Brick4: localhost.localdomain:/home/gfs/r2_3
Options Reconfigured:
nfs.disable: on
performance.readdir-ahead: on
transport.address-family: inet

For the above volume the client translators are named as,
r2-client-0
r2-client-1
r2-client-2
r2-client-3

To set log-level

[root at unused glusterfs]# mount
booradley:/r2 on /mnt/glusterfs type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072)

[root at unused rhs-glusterfs]# cd /mnt/glusterfs
[root at unused glusterfs]# pwd
/mnt/glusterfs

[root at unused glusterfs]# setfattr . -n "trusted.glusterfs.r2-client-0.set-log-level" -v TRACE
[root at unused glusterfs]# setfattr . -n "trusted.glusterfs.r2-client-1.set-log-level" -v TRACE
[root at unused glusterfs]# setfattr . -n "trusted.glusterfs.r2-client-2.set-log-level" -v TRACE
[root at unused glusterfs]# setfattr . -n "trusted.glusterfs.r2-client-3.set-log-level" -v TRACE

Note that this feature is available only for clients/fuse-mount process as of now. Other daemons (bricks, selfheald, rebalance etc) don't have this feature.

regards,
Raghavendra


More information about the Gluster-devel mailing list