欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
InfluxDB
来自开放百科 - 灰狐
(版本间的差异)
小 (→指南) |
小 (→图集) |
||
第74行: | 第74行: | ||
image:realtime-analytics-with-influxdb.jpg|实时分析 | image:realtime-analytics-with-influxdb.jpg|实时分析 | ||
image:devops-monitoring.jpg|DevOps监控 | image:devops-monitoring.jpg|DevOps监控 | ||
+ | image:influxdb-time-series-data-write-ahead-log.png|WAL(Write Ahead Log) | ||
</gallery> | </gallery> | ||
2016年2月23日 (二) 05:17的版本
InfluxDB 是一个 Go 语言开发的开源(MIT)分布式时间序列数据库。
目录 |
TICK堆栈
- Telegraf 数据采集
- InfluxDB 数据存储
- Chronograf 数据可视化
- Kapacitor 监控告警&ETL
应用场景
- 定制DevOps监控(Custom DevOps Monitoring)
- 实时分析(Real Time Analytics)
- 物联网和传感器数据(IoT and Sensor Data)
- 云计算(Cloud & OpenStack)
- 异常检测(Anomaly Detection)
- 消息(Messaging)
- 个性化(Personalization)
- 股票交易(Equities Trading)
- 市政基础设施管理(Municipal Infrastructure Management)
- GPS服务(GPS Services)
- 量子物理研究(Quantum Physics Research)
- POS系统(Point of Sale Systems)
- 制造业和家庭自动化(Manufacturing & Home Automation)
- 运输和物流(Transportation & Material Logistics)
指南
OS X 安装
$ brew update $ brew install influxdb $ influxd $ influx Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring. Connected to http://localhost:8086 version 0.9.6.1 InfluxDB shell 0.9.6.1 > create database mydb > show databases > use mydb > insert cpu,host=serverA,region=us_west value=0.64 > select * from cpu > insert temperature,machine=unit42,type=assembly external=25,internal=37 > select * from temperature > show series > show measurements > show tag keys > show field keys
创建数据库
curl -G 'http://localhost:8086/query' --data-urlencode "q=CREATE DATABASE mydb"
插入数据
curl -XPOST 'http://localhost:8086/write?db=mydb' -d 'cpu,host=server01,region=uswest load=42 1434055562000000000' curl -XPOST 'http://localhost:8086/write?db=mydb' -d 'cpu,host=server02,region=uswest load=78 1434055562000000000' curl -XPOST 'http://localhost:8086/write?db=mydb'-d 'cpu,host=server03,region=useast load=15.4 1434055562000000000'
查询数据
curl -G http://localhost:8086/query?pretty=true --data-urlencode "db=mydb" --data-urlencode "q=SELECT * FROM cpu WHERE host='server01' AND time < now() - 1d"
分析数据
curl -G http://localhost:8086/query?pretty=true --data-urlencode "db=mydb" --data-urlencode "q=SELECT mean(load) FROM cpu WHERE region='uswest'"
sample数据集
curl https://s3-us-west-1.amazonaws.com/noaa.water.database.0.9/NOAA_data.txt > sample-data.txt influx -import -path=sample-data.txt -precision=s
提示信息: 2016/02/23 10:32:35 Processed 76290 inserts
> use NOAA_water_database > show measurements > select count(water_level) from h2o_feet > select * from h2o_feet limit 5
Grafana
Grafana 是面向 Graphite, InfluxDB & OpenTSDB 可视化仪表盘。
图集
链接
分享您的观点