influxdb {"error":"partial write: max-values-per-tag limit exceeded (100009/100000)

3651 단어 influx
influxdb로 데이터를 쓸 때 갑자기 다음과 같은 오류가 발생했습니다. 저는 현재의 최신 버전 1.2를 사용합니다.
java.lang.RuntimeException: {"error":"partial write: max-values-per-tag limit exceeded (100009/100000): measurement=\"t1\" tag=\"openId\" value=\"oGeG_0emqmIf5xakHAZq5_NEbcJ0\"dropped=4"}

        at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:466)
        at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:267)
        at com.ihangmei.datapro.consumer.influxdb.InfluxdbInstance.writeInfluxdb(InfluxdbInstance.java:97)
        at com.ihangmei.datapro.consumer.kafka.WechatRunnable.run(WechatRunnable.java:50)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
java.lang.RuntimeException: {"error":"partial write: max-values-per-tag limit exceeded (100009/100000): measurement=\"t1\" tag=\"openId\" value=\"oGeG_0RngX2VL7c_wmzDNyacMQHI\"dropped=4"}

        at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:466)
        at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:267)
        at com.ihangmei.datapro.consumer.influxdb.InfluxdbInstance.writeInfluxdb(InfluxdbInstance.java:97)
        at com.ihangmei.datapro.consumer.kafka.WechatRunnable.run(WechatRunnable.java:50)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

공식 문서에서 이렇게 말했다.

max-values-per-tag = 100000


The maximum number of tag values allowed per tag key. The default setting is  100000 . Change the setting to  0  to allow an unlimited number of tag values per tag key. If a tag value causes the number of tag values of a tag key to exceed  max-values-per-tag  InfluxDB will not write the point, and it returns a  partial write  error.
Any existing tag keys with tag values that exceed  max-values-per-tag  will continue to accept writes, but writes that create a new tag value will fail.
Environment variable:  INFLUXDB_DATA_MAX_VALUES_PER_TAG
기본적으로 모든 tag key는 최대 10w개의 tag values만 허용합니다. 10w개가 넘으면 위의 오류가 발생합니다. 물론 다른 글에서 우리가 이렇게 하는 이유를 찾았습니다.
influxdb는 tag의 값의 크기를 증가시켰습니다. 최대 값은 10000입니다.만약 기록된 데이터의 tag 값이 제한을 초과하면 호출자는 오류를 보고받을 것입니다.measurement에 기록된 데이터를 방지하는 시리즈-cardinality (series-cardinality) 가 너무 큽니다.만약 우리가 대량의 시리즈-cardinality 높은 데이터를 썼다면, 우리가 데이터를 삭제할 때, InfluxDB는 OOM이 될 것이다.
InfluxDB가 메모리에서 시스템의 모든 시리즈 데이터의 인덱스를 유지했기 때문이다.유일성을 가진 시리즈 데이터 수가 증가함에 따라 RAM의 사용도 증가할 것이다.과도한 series cardinality는 운영체제가 InfluxDB 프로세스를 죽이고 OOM 이상을 던집니다.
참조:https://docs.influxdata.com/influxdb/v1.2/administration/config#max-values-per-tag-100000
http://xiajunhust.github.io/2016/12/13/InfluxDB%E5%86%99%E5%85%A5%E5%A4%B1%E8%B4%A5-partial-write-max-values-per-tag-limit-exceeded/

좋은 웹페이지 즐겨찾기