Authored by root

yoho-java集群和yoho-web集群日志同步以及日志分割

... ... @@ -21,3 +21,7 @@
10.66.16.16
10.66.16.17
10.66.16.9
[yoho-java-container]
10.66.5.242
10.66.5.44
... ...
# rsyslog config for media containers
# rsyslog config for containers
# How to run:
# ansible-playbook -i inventories/media/hosts playbooks/media-rsyslog.yml
# ansible-playbook -i inventories/containers/hosts playbooks/containers-rsyslog.yml
- hosts: media-containers
vars:
... ... @@ -213,3 +213,95 @@
remote_user: root
roles:
- java-rsyslog
- hosts: web-containers
vars:
rsyslog_module: yoho-seo
rsyslog_files:
- seo-task-err
- seo-task-out
- yoho-seo-err
- yoho-seo-out
remote_user: root
roles:
- java-rsyslog
- hosts: web-containers
vars:
rsyslog_module: yoho-doom-spider
rsyslog_files:
- doom-spider-err
- doom-spider-out
- ds-task-err
- ds-task-out
remote_user: root
roles:
- java-rsyslog
- hosts: web-containers
vars:
rsyslog_module: java-yohobuy-global
rsyslog_files:
- nginx/access_yohobuy_global_bs
- nginx/nginx_error
- globalbuy/database-stat
- globalbuy/database-timeout
- globalbuy/debug-log
- globalbuy/warn-log
- globalbuy/mq-consumer
- globalbuy/request-timeout
- globalbuy/use-coupons
remote_user: root
roles:
- java-rsyslog
- hosts: yoho-java-container
vars:
rsyslog_module: yoho-canal
rsyslog_files:
- canal/canal
- yhgrass/yhgrass
- yhgrass/meta
remote_user: root
roles:
- java-rsyslog
- hosts: yoho-java-container
vars:
rsyslog_module: yoho-datasync-consumer
rsyslog_files:
- datacheck-error
- debug
- info
- warn
remote_user: root
roles:
- java-rsyslog
- hosts: yoho-java-container
vars:
rsyslog_module: yoho-datasync-producer
rsyslog_files:
- debug
- info
- warn
remote_user: root
roles:
- java-rsyslog
- hosts: yoho-java-container
vars:
rsyslog_module: yoho-datasync-fullsync
rsyslog_files:
- debug
- info
- warn
- datacheck-error
remote_user: root
roles:
- java-rsyslog
... ...
# logrotate config for containers
# How to run:
# ansible-playbook -i inventories/containers/hosts playbooks/yohoweb-containers.yml
- hosts: web-containers
vars:
logrotate_scripts:
... ... @@ -7,6 +12,9 @@
- "/Data/logs/nginx/yohobuy-node/*.log"
- "/Data/logs/nginx/yoho-activity-platform-admin/*.log"
- "/Data/logs/nginx/yoho-activity-platform/*.log"
- "/Data/logs/yoho-seo/*.log"
- "/Data/logs/yoho-doom-spider/*.log"
- "/Data/logs/java-yohobuy-global/nginx/*.log"
options:
- daily
- size 50M
... ... @@ -18,3 +26,21 @@
remote_user: root
roles:
- logrotate
- hosts: yoho-java-container
vars:
logrotate_scripts:
- name: yoho-java-container
paths:
- "/Data/logs/yoho-canal/canal/*.log"
options:
- daily
- size 50M
- rotate 7
- missingok
- notifempty
- compress
- copytruncate
remote_user: root
roles:
- logrotate
... ...