-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log retention #370
base: develop
Are you sure you want to change the base?
Log retention #370
Conversation
logrotate_config+="}\n" | ||
|
||
# Write logrotate configuration to file | ||
echo -e "$logrotate_config" > "/etc/logrotate.d/$dir_path_name" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
each log file will have a logrotate config file and no cleanup for useless config file (point to not exist log file after a period time)? i do not think it is a good idea.
only one config with multi path using wildcard is suggested. example like /etc/logrotate.d/rsyslog
but we do not have a fixed log file name, glog log to filename+timestamp. so i think use logrotate is not a good idea. you may need create a script to parse and deal our logs, and put it to cron.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我注意到,curve的日志似乎是单日志记录,而且每个日志都会放置在命名规律的文件夹下,例如etcd0、etcd1、mds0、mds1这种,所以使用了logrotate配置。如果担心日志文件被误删除导致文件名更新,我想可以再使用一个 logrotate 配置定期执行log_retention.sh就可以解决了。
b4985ba
to
8b33e10
Compare
@@ -0,0 +1,15 @@ | |||
log_retention.sh文件使用说明: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否每个curve节点都需要执行这个脚本才能完成日志滚动操作?
具体执行命令是bash log_rentention.sh
吗?执行后的效果是什么?能否补充一个示例结果?
是否能定期执行这个脚本?如何定期执行能否举个例子?
log_rentention.sh是否改为logrotate.sh更合适?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
前三个问题已更改,请查看。
因为有清理和轮转两种功能,所以使用了log_rentention。
Signed-off-by: Liao PengFei <[email protected]>
36c322a
to
327899a
Compare
Hi @hdbdn77 首先非常感谢你的贡献 :) |
fix #197
Must be executed on the working node