Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the default configuration of gluster 3.4.5 logrotate?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail what the default configuration of gluster 3.4.5 logrotate is like. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

The default configuration of gluster 3.4.5 logrotate is as follows:

[root@lab25 logrotate.d] # cat glusterd

/ var/log/glusterfs/*glusterd.vol.log {

Missingok

Postrotate

/ bin/kill-HUP `cat / var/run/glusterd.pid 2 > / dev/ null`2 > / dev/null | | true

Endscript

}

[root@lab25 logrotate.d] # cat glusterfsd

/ var/log/glusterfs/*glusterfsd.log / var/log/glusterfs/bricks/*.log {

Missingok

Postrotate

/ bin/kill-HUP `cat / var/run/glusterfsd.pid 2 > / dev/ null`2 > / dev/null | | true

Endscript

}

[root@lab25 logrotate.d] # cat glusterfs-fuse

/ var/log/glusterfs/glusterfs.log {

Missingok

Postrotate

/ usr/bin/killall-HUP gluster 2 > / dev/null | | true

Endscript

}

Description:

1. Under normal circumstances, the glusterfs.log operated by the glusterfs-fuse configuration file does not exist, is useless, is not managed, and can be deleted.

2. The glusterd and glusterfsd configuration files will not cut the client log files (obviously no match), and will retain all the log information.

The problems with the default configuration are explained by the default configuration of CentOS 6.5:

1. By default, logrotate.conf is executed once a week, keeping 4 copies and recording a maximum of 5 weeks of logs, which is too little. (weekly, rotate 4)

2. There is no notifempty option for gluster configuration. If log output has not been used in the last 4 weeks, all 5 log files will be empty and log information will be lost.

3. Log is compressed, so you can consider adding compress option.

To solve the above problems, the modified configuration file is as follows:

[root@lab25 logrotate.d] # cat glusterd

/ var/log/glusterfs/*glusterd.vol.log {

Rotate 4

Dateext

Size 20MB

Notifempty

Sharedscripts

Missingok

Postrotate

/ bin/kill-HUP `cat / var/run/glusterd.pid 2 > / dev/ null`2 > / dev/null | | true

Endscript

}

[root@lab25 logrotate.d] # cat glusterfsd

/ var/log/glusterfs/*glustershd.log / var/log/glusterfs/bricks/*.log {

Rotate 4

Dateext

Size 20MB

Notifempty

Sharedscripts

Missingok

Postrotate

/ bin/kill-HUP `cat / var/run/glusterfsd.pid 2 > / dev/ null`2 > / dev/null | | true

Endscript

}

[root@lab25 logrotate.d] # cat glusterfs-fuse

/ var/log/glusterfs/glusterfs.log {

Rotate 4

Dateext

Size 20MB

Notifempty

Sharedscripts

Missingok

Postrotate

/ usr/bin/killall-HUP gluster 2 > / dev/null | | true

Endscript

}

Modification instructions:

By default, the official log slicing policy given by gluster 3.4.5 is to execute once a week and keep 52 copies.

The disadvantages of this configuration are:

1. There are too many backup log files to be easily viewed.

2. The space occupied by the total log of backup is out of control, and the problem of insufficient space is likely to occur in special cases.

Solution:

Change the cutting policy:

1) once a week, the log file size exceeds 20MB and then executes.

2) keep 4 copies, and the number of single log file + backup does not exceed 100MB.

3) * glusterfsd.log file does not exist and is modified to * glustershd.log.

3) if you want to decompress the space, you can enable log compression and add the following parameters:

Compress

Delaycompress

4) if you want to cut the gluster client log, modify the glusterfs-fuse file and change the glusterfs.log to the target log name.

Note:

If you set log slicing by time, add the notifempty parameter, which will do nothing if the log file is empty.

This is the end of this article on "what is the default configuration of gluster 3.4.5 logrotate?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report