max series per database exceeded
My Influxdb version is influxdb-1.0.2.x86_64.rpm
I'm using the http api to write data.
run: [root@serv xwt]# cat test cpu_info,hostname=hbase49,ipaddr=bond0(10.10.2.32),macaddr=44:a8:42:18:4d:00,kind=CPU,tag=cpu_info,info="Q1BVIOS9v+eUqOeOh+S4ujogOC4wICU" value=8.0 1476158943000000000
[root@serv xwt]# curl -i -XPOST 'http://myInfluxdbAddress:8086/write?db=my_influxdb' --data-binary @test HTTP/1.1 500 Internal Server Error Content-Type: application/json Request-Id: e059f743-966d-11e6-ae46-000000000000 X-Influxdb-Version: 1.0.2 Date: Thu, 20 Oct 2016 02:35:34 GMT Content-Length: 186
{"error":"max series per database exceeded: cpu_info,hostname=hbase49,info="Q1BVIOS9v+eUqOeOh+S4ujogOC4wICU",ipaddr=bond0(10.10.2.32),kind=CPU,macaddr=44:a8:42:18:4d:00,tag=cpu_info"}
What is 'max series per database exceeded' mean?
Maybe below statements could answer your question...
https://github.com/influxdata/influxdb/blob/3910c39424ae9be1cdd4939b6bfa3b6dac196a98/CHANGELOG.md#breaking-changes-1
max-series-per-database was added with a default of 1M but can be disabled by setting it to 0.
Existing databases with series that exceed this limit will continue to load but writes that would create new series will fail.
https://github.com/influxdata/influxdb/blob/master/tsdb/config.go#L66
// Limits
// MaxSeriesPerDatabase is the maximum number of series a node can hold per database.
// When this limit is exceeded, writes return a 'max series per database exceeded' error.
// A value of 0 disables the limit.
MaxSeriesPerDatabase int `toml:"max-series-per-database"`
Solved, very grateful, I will add the following configuration to the [data]: Max-series-per-database = 0
But still can not understand why this test file only one line will get this error too
Would like to know that too, anyway, if your database already has 1000000 series... then even one line of series could trigger the error...
Thanks again
That error indicates that you have exceeded the max-series-per-database limit which is in place to prevent high cardinality data issues before the database is overloaded. High cardinality is a problem because the series index is stored in-memory and can cause memory usage to grow until it OOMs. It also can make queries that are not precise OOM the server. Disabling it is not recommended.
The line that is returned is the series that caused the limit to be exceeded.
It looks like you are writing some problem tags that are going to create high cardinality issues:
cpu_info,hostname=hbase49,info=\"Q1BVIOS9v+eUqOeOh+S4ujogOC4wICU\",ipaddr=bond0(10.10.2.32),kind=CPU,macaddr=44:a8:42:18:4d:00,tag=cpu_info"
The info tag looks like some kind of random string which is problematic for tags. macaddr might also be problematic depending on the cardinality. The docs have some suggestions on schema design to avoid these kinds of schema design problems.
@jwilder Thanks for your replay.
But how cat I store the data just like info and macaddr.
I can not fully understand the meaning of the docs.
@Witee Changing your write to this will store info and macaddr as fields and not tags:
cpu_info,hostname=hbase49,ipaddr=bond0(10.10.2.32),kind=CPU,tag=cpu_info value=8.0,macaddr=44:a8:42:18:4d:00,info="Q1BVIOS9v+eUqOeOh+S4ujogOC4wICU" 1476158943000000000
@jwilder Thank you very much!