OPENTSDB: Request failed: Internal Server Error net.opentsdb.core.IllegalDataException

今天Opentsdb补传历史数据的时候,出现了如下的错误:
Request failed: Internal Server Error net.opentsdb.core.IllegalDataException:Duplicate timestamp for key=[68, -110, -13, 90, 60, -97, 96, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 95, 0, 0, 3, 0, 0, 4], ms_offset=1356000, older=[66, -41, -21, -63], newer=[66, -41, -21, -60]; set tsd.storage.fix_duplicates=true to fix automatically or run Fsck
其实这个错误提示已经非常的明显了,就是在Opentsdb的配置文件opentsdb.conf当中,追加上这个配置条件tsd.storage.fix_duplicates=true即可,如下图所示:
 
这样我们就可以替换重复的数据,Opentsdb可以重新使用,但是这个配置文件是什么意思呢,官网上说这个配置文件的意思是:
Whether or not to accept the last written value when parsing data points with duplicate timestamps. When enabled in conjunction with compactions, a compacted column will be written with the latest data points.
这句话的意思是当同一个时间点有多个值得时候,是否接受最后一个解析数据点的数据,当启用这个fix_duplicates配置的时候,这个列将采用最是的点位这个时间点的值。然后这个配置默认为false,所以我们需要开启这个点。
所以,当我们出现错误时,一定要学会去看提示+官网,百分之80问题可以迎刃而解~
 
aggregator代表各个聚合函数。

avg 平均数据点。空值的插值方式为线性插值。

count 集合中原始数据点的数量。空值的插值方式为0.
max选择集合中最大值。空值的插值方式为线性插值
min选择集合中最小值。空值的插值方式为线性插值
sum集合的累加和。空值的插值方式为线性插值
zimsum集合的累加和。空值的插值方式为0
线性插值:是指使用连接两个已知量的直线来确定在这两个已知量之间的一个未知量的值的方法。
原文地址:https://www.cnblogs.com/wjcoding/p/11690121.html