Commit 9e8ba140 by amir

add fluentd support

parent ff2367d4
Logging containers with fluentd:
[ on local computer ]
http://docs.fluentd.org/articles/install-by-deb :
curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-trusty-td-agent2.sh | sh
- /etc/init.d/td-agent restart
- /etc/init.d/td-agent status
http://www.fluentd.org/guides/recipes/docker-logging
- in_docker.conf:
<source>
type forward
port 24224
bind 0.0.0.0
</source>
// logging to console
<match *.*>
type stdout
</match>
// logging to file
<match *.*>
type file
path /var/log/fluent/dockerlogs
time_slice_format %Y%m%d
time_slice_wait 10m
time_format %Y%m%dT%H%M%S%z
compress gzip
utc
output_time false
output_tag false
buffer_path /var/log/fluent/dockerlogs.*
</match>
and run: [sudo] td-agent -c in_docker.con
[ using containers for fluentd + elk]
docker pull oosidat/fluentd-elasticsearch-container
...@@ -22,6 +22,11 @@ ui-api: ...@@ -22,6 +22,11 @@ ui-api:
- "8010:8080" - "8010:8080"
- "8443:8443" - "8443:8443"
- "9080:9080" - "9080:9080"
log_driver: fluentd
# example for remote fluentd agent
log_opt:
fluentd-address: 172.16.1.244:24224
# fluentd-tag: ui-api
public-safety: public-safety:
environment: environment:
IPG_ENV_PARAMS: "-Dds.IpAddress=172.16.1.97:8080#\ IPG_ENV_PARAMS: "-Dds.IpAddress=172.16.1.97:8080#\
...@@ -32,6 +37,7 @@ public-safety: ...@@ -32,6 +37,7 @@ public-safety:
ports: ports:
- "8100:8000" - "8100:8000"
- "50005:50005" - "50005:50005"
log_driver: fluentd
data-logic: data-logic:
environment: environment:
IPG_ENV_PARAMS: "-DdataLogic.ds.IpAddress=172.16.1.97:8080#\ IPG_ENV_PARAMS: "-DdataLogic.ds.IpAddress=172.16.1.97:8080#\
...@@ -41,6 +47,7 @@ data-logic: ...@@ -41,6 +47,7 @@ data-logic:
ports: ports:
- "8110:8000" - "8110:8000"
- "50045:50045" - "50045:50045"
log_driver: fluentd
push-server: push-server:
environment: environment:
IPG_ENV_PARAMS: "-Dredis.host=172.16.1.244" IPG_ENV_PARAMS: "-Dredis.host=172.16.1.244"
...@@ -49,6 +56,7 @@ push-server: ...@@ -49,6 +56,7 @@ push-server:
ports: ports:
- "8120:8000" - "8120:8000"
- "50000:50000" - "50000:50000"
log_driver: fluentd
ui-web: ui-web:
image: 172.16.1.212:5050/mcx/ui-web image: 172.16.1.212:5050/mcx/ui-web
ports: ports:
......
<source>
type forward
port 24224
bind 0.0.0.0
</source>
<match *.*>
type file
path /var/log/fluent/dockerlogs
time_slice_format %Y%m%d
time_slice_wait 10m
time_format %Y%m%dT%H%M%S%z
compress gzip
utc
output_time false
output_tag false
</match>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment