涛思数据库使用taosBenchmark生成一亿条测试数据

jian436 2022-08-05 17:50:47

上次在文档中直接使用命令taosBenchmark生成一亿条数据,发现不满足要求,都是2017年开始的 数据,下面是用json格式生成2022-07-29开始,名为db的数据库,生成的列和标签都可以自定义。
参考资料
docker run -d --name iot-tdengine --hostname="tdengine-server" -v /home/taos/log:/var/log/taos -v /home/taos/data:/var/lib/taos -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp tdengine/tdengine:2.6.0.8

  1. 在目录下/home/taos/data(因为容器里边没有vi命令,容器挂载了这个目录),创建testben.json文件
    {
     "filetype": "insert",
     "cfgdir": "/etc/taos",
     "host": "127.0.0.1",
     "port": 6030,
     "user": "root",
     "password": "taosdata",
     "connection_pool_size": 8,
     "thread_count": 4,
     "result_file": "./insert_res.txt",
     "confirm_parameter_prompt": "no",
     "insert_interval": 0,
     "interlace_rows": 100,
     "num_of_records_per_req": 100,
     "prepared_rand": 10000,
     "chinese":"no",
     "databases": [{
       "dbinfo": {
         "name": "db",
         "drop": "yes",
         "replica": 1,
         "days": 10,
         "cache": 16,
         "blocks": 8,
         "precision": "ms",
         "keep": 3650,
         "minRows": 100,
         "maxRows": 4096,
         "comp":2,
         "walLevel":1,
         "cachelast":0,
         "quorum":1,
         "fsync":3000,
         "update": 0
       },
       "super_tables": [{
         "name": "stb",
         "child_table_exists":"no",
         "childtable_count": 100,
         "childtable_prefix": "stb_",
         "escape_character": "no",
         "auto_create_table": "yes",
         "batch_create_tbl_num": 10,
         "data_source": "rand",
         "insert_mode": "taosc",
         "line_protocol": "line",
         "insert_rows": 10000,
         "childtable_limit": 10,
         "childtable_offset": 1000,
         "interlace_rows": 0,
         "insert_interval":0,
         "partial_col_num": 0,
         "disorder_ratio": 0,
         "disorder_range": 1000,
         "timestamp_step": 60000,
         "start_timestamp": "2022-07-29 00:00:00.000",
         "sample_format": "csv",
         "sample_file": "./sample.csv",
         "use_sample_ts": "yes",
         "tags_file": "",
         "columns": [{"type": "INT", "name": "id"}, {"type": "INT", "count":2}, {"type": "INT", "count":1,"max": 888, "min": 1}, {"type": "BINARY",  "count":1}],
         "tags": [{"type": "TINYINT", "count":2, "max": 99, "min": 1}, {"type": "BINARY", "len": 16, "count":2, "values":["beijing","shanghai"]}]
       }]
     }]
    }
    
  2. 进入容器
    cd /home/taos/data
    ls
    发现testben.json
  3. 执行命令
    taosBenchmark -f testben.json
...全文
416 回复 打赏 收藏 举报
写回复
回复
切换为时间正序
请发表友善的回复…
发表回复
发帖
ThingLinks社区

303

社区成员

ThingLinks物联网一体化平台社区 版本将持续迭代更新,支持商业二开; 欢迎你分享物联网及平台相关技术文档;
物联网能源开源 企业社区
社区管理员
  • xiaonannet
  • jian436
  • 很久是多久
加入社区
帖子事件
编辑了帖子 (查看)
2022-08-05 17:53
编辑了帖子 (查看)
2022-08-05 17:51
创建了帖子
2022-08-05 17:50
社区公告

ThingLinks物联网一体化平台社区

https://gitee.com/mqttsnet/thinglinks

https://github.com/mqttsnet/thinglinks