influxdb 全家桶運行


一個簡單的demo,集成了telegraf,influxdb,chronograf,kapacitor,nginx,一張來自官方的參考圖

組件集成圖

環境准備

使用docker-compose

  • 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/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM