首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在KairosDB中大容量插入数据

在KairosDB中大容量插入数据
EN

Stack Overflow用户
提问于 2015-08-10 23:13:44
回答 1查看 874关注 0票数 3

在这个链接中,我们可以将数据导入到KairosDB中:this link

代码语言:javascript
复制
>bin/kairosdb.sh import -f export.txt
If you happened to compress the export you can pipe it back into the system like this:

>gzip -dc export.gz | bin/kairosdb.sh import

我不确定export.txt文件应该是什么格式

我有一个类似如下的文件(export.txt):

代码语言:javascript
复制
Building_id,building_type,meter_type,unit,timestamp,value
1,Elementary School,temperature,F,1359695700,34.85
2,Park,temperature,F,1359695700,0
3,Industrial,temperature,F,1359695700,0.07
4,Recreation Center,temperature,F,1359695700,0
5,Park,temperature,F,1359695700,2.2
6,Community Center,temperature,F,1359695700,31.41
7,Office,temperature,F,1359695700,0
8,Elementary School,temperature,F,1359695700,10.88
9,Elementary School,temperature,F,1359695700,42.27
.
.

我想把这些数据批量插入到kairosDB中,我该怎么做呢?

EN

回答 1

Stack Overflow用户

发布于 2015-08-11 19:37:42

导入/导出功能使用JSON格式,有点类似于通过REST API发送到推送数据的格式(c.f.http://kairosdb.github.io/kairosdocs/restapi/AddDataPoints.html )。每行一个JSON文档。

代码语言:javascript
复制
{
    "name": "kairosdb.jvm.free_memory",
    "tags": {
        "host": "TTES"
    },
    "datapoints": [
        [
            1438184280003,
            850322752
        ],        
        [
            1438184281003,
            850322753
        ]

]
}

AFAIK import命令旨在导入以前使用export命令转储的数据,而不是使用新数据填充数据库(您可能更喜欢使用telnet或REST接口)。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31923218

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档