docker compose中所有容器的集中式logrotate容器
我的logrotate容器给了我以下错误:docker compose中所有容器的集中式logrotate容器,docker,docker-compose,containers,logrotate,Docker,Docker Compose,Containers,Logrotate,我的logrotate容器给了我以下错误: error: Ignoring activity_logs because it is writable by group or others. error: Ignoring httpd because it is writable by group or others. error: Ignoring reminder_cron because it is writable by group or others. activity\u日志和rem
error: Ignoring activity_logs because it is writable by group or others.
error: Ignoring httpd because it is writable by group or others.
error: Ignoring reminder_cron because it is writable by group or others.
activity\u日志
和remention\u cron
存在于/opt/logs
目录中,而httpd
存在于/var/log/httpd
以下是安装在logrotate
容器中时文件夹的权限:
drwxr-xr-x 2 root root 64 Aug 27 04:08 logs
drwxrwxr-x 2 root root 64 Sep 1 20:45 httpd
Logrotate使用根用户运行
我正在尝试为所有docker容器设置集中式logrotate。
以下是我的docker-compose.yml文件:
version: '3'
services:
server:
image: private-apache:latest
command: /usr/sbin/apachectl -DFOREGROUND
ports:
- "XXXX:XXXX"
volumes:
- ./html:/var/www/html
- ./opt:/opt
- ./logs/httpd:/var/log/httpd
- ./data/tmp:/tmp
links:
- mysql
- redis
- beanstalkd
- rsyslog
restart: always
logrotate:
image: private-logrotate:latest
command: /usr/sbin/crond -f
volumes:
- ./logs/rsyslog/var/log:/var/log
- ./opt/logs:/opt/logs
- ./logs/httpd:/var/log/httpd
restart: always
rsyslog:
image: private-rsyslog:latest
ports:
- "XXX:XXX"
volumes:
- ./logs/rsyslog/var/log:/var/log
restart: always
depends_on:
- logrotate
mysql:
image: private-mysql:latest
privileged: false
ports:
- "XXXX:XXXX"
volumes:
- ./data/mysql:/var/lib/mysql
- ./data/tmp:/tmp
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=databasename
restart: always
redis:
image: private-redis:latest
ports:
- "XXXX:XXXX"
volumes:
- ./data/redis:/var/lib/redis
restart: always
beanstalkd:
image: private-beanstalkd:latest
restart: always
ports:
- "XXXX:XXXX"
服务器
容器和rsyslog
容器生成不同用户的日志logrotate
容器不知道这些用户,因此将su
放入/etc/logrotate.d/httpd
,/etc/logrotate.d/activity\u log
和/etc/logrotate.d/提醒\u cron
是不可能的。
我想知道是否可以强制logrotate忽略这些错误,并从装入的卷中旋转日志。
或者有没有更好的方法来做到这一点
我们的想法是为所有容器设置一个中心日志