微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

influxdb 全家桶运行

一个简单的demo,集成了telegraf,influxdb,chronograf,kapacitor,Nginx,一张来自官方的参考图

组件集成图

环境准备

使用docker-compose

version: "3"
services:
    Nginx:
      image: Nginx
      ports:
      - "8080:8080"
      volumes: 
      - "./index.html:/usr/share/Nginx/html/index.html"
      - "./Nginx.conf:/etc/Nginx/Nginx.conf"
    timescaledb:
      image: timescale/timescaledb-postgis:latest-pg10
      ports:
      - "5432:5432"
      environment:
      - "POSTGRES_PASSWORD=dalong"
    influxdb:
      image: influxdb
      ports: 
      - "8086:8086"
    telegraf:
      image: telegraf
      volumes: 
      - "./telegraf.conf:/etc/telegraf/telegraf.conf"
    chronograf:
      image: chronograf
      ports:
      - "8888:8888"
      command: --influxdb-url=http://influxdb:8086
    kapacitor:
      image: kapacitor
      environment:
      - "KAPACITOR_INFLUXDB_0_URLS_0=http://influxdb:8086"
      ports:
      - "9092:9092"
   
  • telegraf 配置

    主要添加Nginx input 以及配置了influxdb 信息 telegraf.conf

[[outputs.influxdb]]
  urls = ["http://influxdb:8086"]
[[inputs.Nginx]]
  # An array of Nginx stub_status URI to gather stats.
  urls = ["http://Nginx:8080/ngx_status"]
   

运行&&效果

  • 启动
docker-compose up -d
 


参考资料

https://github.com/rongfengliang/outflux-influxdb-demo
https://www.influxdata.com/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐