20 lines
701 B
Markdown
20 lines
701 B
Markdown
influx操作示例
|
||
===
|
||
|
||
### 安装
|
||
* influxDB 1.x版本
|
||
go get github.com/influxdata/influxdb1-client/v2
|
||
* influxDB 2.x版本
|
||
go get github.com/influxdata/influxdb-client-go
|
||
|
||
### 行协议介绍
|
||
https://jasper-zhang1.gitbooks.io/influxdb/content/Write_protocols/line_protocol.html
|
||
|
||
###### 语法
|
||
一行Line Protocol表示InfluxDB中的一个数据点。它向InfluxDB通知点的measurement,tag set,field set和timestamp。
|
||
|
||
### 写数据到InfluxDB
|
||
###### HTTP API
|
||
curl -i -XPOST "http://localhost:8086/write?db=science_is_cool" --data-binary 'weather,location=us-midwest temperature=82 1465839830100400200'
|
||
###### CLI
|
||
INSERT weather,location=us-midwest temperature=82 1465839830100400200 |