[Gluster-users] How do I rotate **all** the Gluster logs?
Greg Scott
GregScott at infrasupport.com
Fri Jul 19 21:09:37 UTC 2013
From Vijay:
> The appropriate mechanism to do log rotation would be to use logrotate command with the
> config file available at /etc/logrotate.d/glusterfs. This mechanism rotates log files of all glusterfs processes.
> The log rotate <volname> command will be deprecated in a future release.
And from Joe:
> Semiosis and I have found copytruncate to be a reliable method to use with logrotate.
And from looking up what "semiosis" means on Wikipedia: (How do you pronounce that word?)
http://en.wikipedia.org/wiki/Semiosis
I think Joe is trying to tell me I was too long-winded earlier. I think. If so, sorry. I had to chase down the details on how logrotate works every day and I figured the chain of events might be valuable for anyone else with a similar issue.
Let's come at this another way. Vijay suggests:
> ...use logrotate command with the config file available at /etc/logrotate.d/glusterfs...
And that should take care of rotating all the Gluster logs. It turns out, not quite that simple - there is no /etc/logrotate.d/glusterfs directory, but there are two files in /etc/logrotate that look like they came from Gluster. It's simple enough to try them. Details below. The summary result is, nothing happens. See for yourself below. The before and after directories are identical. Nothing rotated.
Also, this apparently already runs every day anyway as part of the normal cron.daily process I documented earlier in apparently painful detail, so I should already see evidence of rotated log files without running these by hand.
So right this minute, I don't see any provision out of the box that takes care of the log files for volumes. That's my question. How do I handle the log file for my volume? I can't have this system run out of disk space to accommodate an ever-growing log file. I'll be barbecued.
[root at chicago-fw1 logrotate.d]# ls /etc/logrotate.d
chrony firewall-scripts glusterfs-fuse iscsiuiolog libvirtd.qemu psacct sssd wpa_supplicant
cups glusterd httpd libvirtd libvirtd.uml samba syslog yum
dracut_log glusterfsd iptraf-ng libvirtd.lxc ppp squid vsftpd
[root at chicago-fw1 logrotate.d]#
[root at chicago-fw1 logrotate.d]#
[root at chicago-fw1 logrotate.d]#
[root at chicago-fw1 logrotate.d]# ls -al /var/log/glusterfs
total 1452
drwxr-xr-x. 5 root root 4096 Jun 28 10:48 .
drwxr-xr-x. 25 root root 4096 Jul 19 07:01 ..
drwxr-xr-x. 2 root root 4096 Jul 18 15:33 bricks
-rw-------. 1 root root 11763 Jul 19 05:54 cli.log
-rw-------. 1 root root 545 Jul 19 05:54 .cmd_log_history
-rw-------. 1 root root 146816 Jul 19 11:51 etc-glusterfs-glusterd.vol.log
-rw-------. 1 root root 10160 Jul 13 18:43 etc-glusterfs-glusterd.vol.log-20130714
-rw-------. 1 root root 714670 Jul 19 11:51 firewall-scripts.log
drwxr-xr-x. 2 root root 4096 Jul 13 18:39 geo-replication
drwxr-xr-x. 3 root root 4096 Jul 13 18:39 geo-replication-slaves
-rw-------. 1 root root 335825 Jul 19 11:49 glustershd.log
-rw-------. 1 root root 218787 Jul 19 11:49 nfs.log
[root at chicago-fw1 logrotate.d]#
[root at chicago-fw1 logrotate.d]#
[root at chicago-fw1 logrotate.d]# logrotate /etc/logrotate.d/glusterd
[root at chicago-fw1 logrotate.d]# logrotate /etc/logrotate.d/glusterfsd
[root at chicago-fw1 logrotate.d]#
[root at chicago-fw1 logrotate.d]#
[root at chicago-fw1 logrotate.d]# ls -al /var/log/glusterfs
total 1452
drwxr-xr-x. 5 root root 4096 Jun 28 10:48 .
drwxr-xr-x. 25 root root 4096 Jul 19 07:01 ..
drwxr-xr-x. 2 root root 4096 Jul 18 15:33 bricks
-rw-------. 1 root root 11763 Jul 19 05:54 cli.log
-rw-------. 1 root root 545 Jul 19 05:54 .cmd_log_history
-rw-------. 1 root root 146816 Jul 19 11:51 etc-glusterfs-glusterd.vol.log
-rw-------. 1 root root 10160 Jul 13 18:43 etc-glusterfs-glusterd.vol.log-20130714
-rw-------. 1 root root 714670 Jul 19 11:51 firewall-scripts.log
drwxr-xr-x. 2 root root 4096 Jul 13 18:39 geo-replication
drwxr-xr-x. 3 root root 4096 Jul 13 18:39 geo-replication-slaves
-rw-------. 1 root root 335825 Jul 19 11:49 glustershd.log
-rw-------. 1 root root 218787 Jul 19 11:49 nfs.log
[root at chicago-fw1 logrotate.d]#
- Greg
More information about the Gluster-users
mailing list