更新 InfluxDB 基础使用

douxu 2024-08-15 15:07:56 +08:00
parent 77874b7d92
commit cebf86b4f3
1 changed files with 28 additions and 0 deletions

@ -4,6 +4,28 @@
使用` docker start -d --name influxdb -p 27017:27017 influxdb:2.7.8`启动InfluxDB 容器
## Influxdb UI
### 使用 variables 配置 Dashboard
### 创建 Dashboard query statment
`from(bucket: v.bucket)
|> range(start: -30d, stop: -1d)
|> filter(fn: (r) => r._measurement == v.measurement)`
### 创建 bucket variables
`buckets()
|> filter(fn: (r) => r.name !~ /^_/)
|> rename(columns: {name: "_value"})
|> keep(columns: ["_value"])`
### 创建 measurement variables
`import "influxdata/influxdb/schema"
schema.measurements(bucket: v.bucket)`
## InfluxDB 认证
使用`influx auth create [permission-flags]`命令创建令牌。
@ -16,6 +38,12 @@
### 查看令牌
使用`influx auth list` 命令来查看相关令牌详情
### 激活令牌
使用`influx auth active --ID xxxxxxxxxxxxxxxx` 激活令牌
### 删除令牌
使用`influx auth inactive --ID xxxxxxxxxxxxxxxx` 停用令牌
### 401 Unauthorized认证解决方案
使用`influx config create --config-name CONFIG_NAME --host_url HOST_URL --org ORG --token API_TOKEN --active`创建认证配置