前提环境:
1.安装docker
2.安装好influxDB
A.fluent安装配置
目录结构如下
1.编写fluent.conf配置文件
<source>
@type forward
port 24224
bind 0.0.0.0
</source>
<match **>
@type influxdb
host 填写数据库所在ip,如:127.0.0.1
port 8086
dbname 填写database的名称,如test
user 填写数据库用户名,如root
password 填写你的数据库密码,如123456
use_ssl false
time_precision ms
auto_tags false
tag_keys ["hostname","age"]此数组为索引字段名称,插入的key为数组对应的值则新增数据时默认设置该字段为索引字段
sequence_tag _seq
</match>
详细配置可参考
https://github.com/fangli/fluent-plugin-influxdb
2.编写docker build 脚本
docker build -t test .
3.编写好docker run脚本
doc