我使用以下命令在kairosdb中插入数据:reference
bin / kairosdb.sh import -f export.txt
但是在kairosdb.log文件中我收到以下错误:
08-10|13:54:33.443 [main] INFO [Main.java:267] - KairosDB service started
08-10|13:54:33.443 [main] INFO [Main.java:268] - ------------------------------------------
08-10|14:00:38.236 [main] INFO [TelnetServerModule.java:42] - Configuring module TelnetServerModule
08-10|14:00:39.259 [main] INFO [CassandraHostRetryService.java:48] - Downed Host Retry service started with queue size -1 and retry delay 10s
08-10|14:00:39.357 [main] INFO [JmxMonitor.java:52] - Registering JMX me.prettyprint.cassandra.service_kairosdb-cluster:ServiceType=hector,MonitorType=hector
08-10|14:00:39.734 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.
08-10|14:00:40.023 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.
08-10|14:00:40.216 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.
08-10|14:00:40.295 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.
08-10|14:00:40.391 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.
08-10|14:00:40.439 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.
我的export.txt文件是:
administrator@administrator-IdeaCentre-Q190:~/Abharthan/kairosdb$ head -10 export.txt
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"1","building_type":"ElementarySchool","meter_type":"temperature","unit":"F"},"value":"34.85"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"2","building_type":"Park","meter_type":"temperature","unit":"F"},"value":"0"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"3","building_type":"Industrial","meter_type":"temperature","unit":"F"},"value":"0.07"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"4","building_type":"RecreationCenter","meter_type":"temperature","unit":"F"},"value":"0"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"5","building_type":"Park","meter_type":"temperature","unit":"F"},"value":"2.2"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"6","building_type":"CommunityCenter","meter_type":"temperature","unit":"F"},"value":"31.41"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"7","building_type":"Office","meter_type":"temperature","unit":"F"},"value":"0"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"8","building_type":"ElementarySchool","meter_type":"temperature","unit":"F"},"value":"10.88"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"9","building_type":"ElementarySchool","meter_type":"temperature","unit":"F"},"value":"42.27"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"10","building_type":"ElementarySchool","meter_type":"temperature","unit":"F"},"value":"10.14"}
请建议如何解决此错误。
答案 0 :(得分:1)
通常您描述的问题来自提供没有关联值的标签。 TIt看起来像你的第一行10之后的值为building_type的空值(查找"building_type":""
或类似)。
通过查看您的JSON,我发现了几个不相关的可能问题: