influxdb 中,series 是一个很重要的概念,它是 retentionPolicy、measurement、tag set 雷同的汇合,蕴含了监控对象的元数据信息,series 的数量 =RP*measurement*tag set。
一般来讲,监控对象稳固后,series 根本是固定的;influxdb 将 series 放在内存作为索引,放慢了数据查问,这使得 series 的数量不能太大,否则 influxdb 内存会被撑爆,默认单个 database 内 series 限度为 <100W 个。
// influxdb.conf
# The maximum series allowed per database before writes are dropped. This limit can prevent
# high cardinality issues at the database level. This limit can be disabled by setting it to
# 0.
# max-series-per-database = 1000000
series 汇合的例子:每一行代表一个 series
序号 | retention policy | measuerment | tag set |
---|---|---|---|
1 | autogen | cpu.used.percent | location=sh,node=node1001 |
2 | autogen | cpu.used.percent | location=bj,node=node3001 |
3 | autogen | cpu.used.percent | location=sz,node=5001 |
查问 series 信息
查问所有的 series
# influx -execute 'show series on opsultra'
统计所有的 series 数量
# influx -execute 'show series on opsultra' |wc -l
将 series 导出到 csv
# influx -execute 'show series on opsultra' -format 'csv' > /tmp/series.csv
查问 series cardinality
cardinality 反馈了 series 的维度,即不同的 series 的数量:
查问 series 的维度
# influx -execute 'show series cardinality on opsultra'
将 series 的维度导出到 csv: 按 measurement 进行 cardinality 进行统计
# influx -execute 'show series exact cardinality on opsultra' -format 'csv' > /tmp/series.csv
参考:
https://jasper-zhang1.gitbook…
https://docs.influxdata.com/i…