Docker容器日志集中收集(client-server模式)

四个docker容器,其中三个作为client,一个作为server,每个容器都安装了fluentd,client监控本地日志文件,每次将文件末尾新添加的日志信息转发到server,server接收后存储到server本地;

配置文件所在目录:/etc/td-agent/td-agent.conf

client配置


    @type tail
    path /var/log/client1.log
	pos_file /var/log/td-agent/client1.log.pos
	tag client1
	
		@type json
	



	@type forward
	
		host 172.17.0.2
		port 24224
	
	flush_interval 10s

server端配置


    @type forward
    port 24224



    @type file
    #path /var/log/td-agent/client-log/log.%Y%m%d
    path /var/log/td-agent/access
    time_format %Y-%m-%d %H:%M:%S

 

你可能感兴趣的:(学习笔记)