The backup-core project contains the main business logic and implementation methods, this project can provides external services in the form of jar packages.
The backup-command project is a tool class package,The function implementation depends on the core project and provides a command line tool.
Precondition:
mvn clean package; mvn install; mvn test;
ps: you can add ‘-DskipTests’ to skip those tests.
Since the core-jar has not been placed on the remote repository, to compile the tools smoothly, you first need to execute mvn install -DskipTests.
The integration tests need a real iotdbserver,you can config the server in “test/resource/sesseinConfig.properties”
Pipeline design document: https://apache-iotdb.feishu.cn/wiki/wikcn8zaxOegcQ4vBASwtmbmE4f
Export command tool: data-export.bat/data-export.sh
-h // iotdb host address -p // port -u // username -pw // password -f // fileFolder -i // iotdbPath -sy // file generation strategy, exclude export tsfile,others could use this param -se // Whether a time series structure is required,if true the tool will export a new file which will record the timeseries structure -c // compress type : SQL、CSV、SNAPPY、GZIP、LZ4 -w // where -vn // virtualNum export tsfile could use this param -pi // partitionInterval export tsfile could use this param
Import command tool: data-import.bat/data-import.sh
-h // iotdb host address -p // port -u // username -pw // password -f // fileFolder -se // Whether a time series structure is required,if true the tool will export a new file which will record the timeseries structure -c // compress type : SQL、CSV、SNAPPY、GZIP、LZ4
Scenario description:
There are two excavators d1 and d2 under the storage group root.ln.company1 There is a taxi fleet team1 under the storage group root.ln.company2
Export the d1 device, export the file to d:/company1/machine, select the second file strategy (extra file), need to generate a time series structure, the file format is gzip
data-export.bat -h 127.0.0.1 -p 6667 -u root -pw root -f d:\\company1\\machine -i root.ln.company1.diggingMachine.d1 -sy true -se true -c gzip
Export results: TIMESERIES_STRUCTURE.STRUCTURE records the time series structure CATALOG_COMPRESS.CATALOG records the correspondence between file names and device paths 1.gz.bin
Export all devices under company1, export the file to d:/company1/machine, select the first file strategy, do not need to generate a time series structure, the file format is csv
data-export.bat -h 127.0.0.1 -p 6667 -u root -pw root -f d:\\company1\\machine -i root.ln.company1.** -sy false -se false -c csv
Export results: d2.csv d1.csv
Export all devices under root.ln, export files to d:/all/devices, select the first file strategy, need to generate time series structure, file format csv
data-export.bat -h 127.0.0.1 -p 6667 -u root -pw root -f d:\\all\\devices -i root.ln.** -sy false -se true -c csv -w "time > 1651036025230"
Export results: TIMESERIES_STRUCTURE.STRUCTURE records the time series structure d2.csv d1.csv team1.csv
Import data, specify the folder d:/all/devices to export data, need to import time series, file format csv
data-import.bat -h 127.0.0.1 -p 6667 -u root -pw root -f d:\\all\\devices -se true -c csv
ps: export tsfile
data-export.bat -h 127.0.0.1 -p 6667 -u root -pw root -f d:\\tsfileexport\\A106 -i root.yyy.** -se false -c tsfile -vn 3 -pi 604800
if you want to import tsfile,please use Load External TsFile Tool.