我试图在openshift中使用logrotate旋转apache日志。
当我试图测试logrotate功能时,它给了我下面的错误信息。
logrotate -d httpd
其中httpd是存在于etclogrotate.d中的文件。
错误:logrotate UID不在passwd文件中。Logrotate UID is not in passwd file.error: error creating state file varlib...logrotate.status.
请让我知道是否有解决这个问题的办法,或者说在openshift中是否可以进行logrotation?
你应该避免在容器中使用 logrotate。一般来说,你不应该在容器中使用日志文件,而应该始终将日志记录到 stdout
.
这是一个最佳做法。十二因素应用 和OpenShift自带的Logging Stack来处理日志。