influxDB数据导出导入(数据压缩)

导出数据

influx_inspect export -datadir "/data/influxdb/data" -waldir "/data/influxdb/wal" -out "XX" -database XX -start 2019-07-21T08:00:01Z

 

命令解释

influx_inspect export
-datadir "/data/influxdb/data" # nfluxdb 默认的数据存储位置
-waldir "/data/influxdb/wal" # influxdb 默认的数据交换位置
-out "telemetry_vcdu_time" # 导出数据文件的文件名
-database telemetry_vcdu_time # 指定要导出数据的数据库
-start 2019-07-21T08:00:01Z # 指定要导出的数据的起始时间

 


导入数据

influx -import -path=telemetry_sat_time -precision=ns

 


命令解释

influx
-import # 无参,勿动
-path=XX # 指定导入数据的文件
-precision=ns # 指定导入数据的时间精度

 

 

若数据量大,可使用一下命令进行数据压缩导出: 

influx_inspect export -datadir "/data/influxdb/data" -waldir "/data/influxdb/wal" -out "XX" -database XX -start 2019-07-21T08:00:01Z -compress=true

 

数据恢复的时候添加-compressed参数,表示数据文件为压缩文件

Format specifies the format of the server responses: json, csv, or column. -precision 'rfc3339|h|m|s|ms|u|ns' Precision specifies the format of the timestamp: rfc3339, h, m, s, ms, u or ns. -consistency 'any|one|quorum|all' Set write consistency level: any, one, quorum, or all -pretty Turns on pretty print for the json format. -import Import a previous database export from file -pps How many points per second the import will allow. By default it is zero and will not throttle importing. -path Path to file to import -compressed Set to true if the import file is compressed

 

posted @ 2021-10-29 13:24  银鑫  阅读(1187)  评论(0编辑  收藏  举报