導出數據
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