做公众号的网站模板,wordpress图片使用图床,北京建设网服务大厅,营销型网站九大特点前言 taosdump 是一个支持从运行中的 TDengine 集群备份数据并将备份的数据恢复到相同或另一个运行中的 TDengine 集群中的工具应用程序。 taosdump 可以用数据库、超级表或普通表作为逻辑数据单元进行备份#xff0c;也可以对数据库、超级 表和普通表中指定时间段内的数据记录…前言 taosdump 是一个支持从运行中的 TDengine 集群备份数据并将备份的数据恢复到相同或另一个运行中的 TDengine 集群中的工具应用程序。 taosdump 可以用数据库、超级表或普通表作为逻辑数据单元进行备份也可以对数据库、超级 表和普通表中指定时间段内的数据记录进行备份。使用时可以指定数据备份的目录路径如果 不指定位置taosdump 默认会将数据备份到当前目录。 如果指定的位置已经有数据文件taosdump 会提示用户并立即退出避免数据被覆盖。这意味着同一路径只能被用于一次备份。 如果看到相关提示请小心操作。 一、taodump简介安装及使用 https://docs.taosdata.com/reference/taosdump/#%E7%AE%80%E4%BB%8B 二、taoTools安装 安装包下载https://docs.taosdata.com/releases/tools/ 三、详细dump命令 Usage: taosdump [OPTION...] dbname [tbname ...]or: taosdump [OPTION...] --databases db1,db2,...or: taosdump [OPTION...] --all-databasesor: taosdump [OPTION...] -i inpathor: taosdump [OPTION...] -o outpath-h, --hostHOST Server host dumping data from. Default islocalhost.-p, --password User password to connect to server. Default istaosdata.-P, --portPORT Port to connect-u, --userUSER User name used to connect to server. Default isroot.-c, --config-dirCONFIG_DIR Configure directory. Default is /etc/taos-i, --inpathINPATH Input file path.-o, --outpathOUTPATH Output file path.-r, --resultFileRESULTFILE DumpOut/In Result file path and name.-a, --allow-sys Allow to dump system database-A, --all-databases Dump all databases.-D, --databasesDATABASES Dump inputted databases. Use comma to separatedatabases name.-e, --escape-character Use escaped character for database name-N, --without-property Dump database without its properties.-s, --schemaonly Only dump tables schema.-d, --avro-codecsnappy Choose an avro codec among null, deflate, snappy,and lzma.-S, --start-timeSTART_TIME Start time to dump. Either epoch orISO8601/RFC3339 format is acceptable. ISO8601format example: 2017-10-01T00:00:00.0000800 or2017-10-0100:00:00:0000800 or 2017-10-0100:00:00.0000800-E, --end-timeEND_TIME End time to dump. Either epoch or ISO8601/RFC3339format is acceptable. ISO8601 format example:2017-10-01T00:00:00.0000800 or2017-10-0100:00:00.0000800 or 2017-10-0100:00:00.0000800-B, --data-batchDATA_BATCH Number of data per query/insert statement whenbackup/restore. Default value is 16384. If you seeerror actual dump .. batch .. when backup or ifyou see WAL size exceeds limit error whenrestore, please adjust the value to a smaller oneand try. The workable value is related to thelength of the row and type of table schema.-I, --inspect inspect avro file content and print on screen-L, --loose-mode Using loose mode if the table name and column nameuse letter and number only. Default is NOT.-n, --no-escape No escape char . Default is using it.-Q, --dot-replace Repalce dot character with underline character inthe table name.(Version 2.5.3)-T, --thread-numTHREAD_NUM Number of thread for dump in file. Default is8.-C, --cloudCLOUD_DSN specify a DSN to access TDengine cloud service-R, --restful Use RESTful interface to connect TDengine-t, --timeoutSECONDS The timeout seconds for websocket to interact.-g, --debug Print debug info.-?, --help Give this help list--usage Give a short usage message-V, --version Print program version-W, --renameRENAME-LIST Rename database name with new name duringimporting data. RENAME-LIST: db1newDB1|db2newDB2 means rename db1 to newDB1and rename db2 to newDB2 (Version 2.5.4)Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.Report bugs to supporttaosdata.com.dev环境TDengie数据按照时间导出 --查询TDengie中当前时间范围内的数据
select count(*) from 超级表 where time 2024-01-01T00:00:00.0000800 and time 2024-06-30T23:59:59.0000800;
本次导出数量3378
总数量7383--查询TDengine当前时间范围内的数据
select count(*) from 超级表 where time 2024-01-01T00:00:00.0000800 and time 2024-06-30T23:59:59.0000800;
本次导出数量3701
总数量3944当前时间范围内数据导出
taosdump -D 数据库名 -o /home/taosdata -S 2024-01-01T00:00:00.0000800 -E 2024-06-30T23:59:59.0000800恢复当前导出的数据到另外一台TDengine测试时使用的是我本地的虚拟机中安装的TDengine
taosdump -u root -p 123456 -i /home/taosdatadev环境TDengie数据增量导出 --TDengine中剩余数据4005
select count(*) from 超级表 where time 2023-01-01T00:00:00.0000800 and time 2024-01-01T00:00:00.0000800;--TDengine中剩余数据243
select count(*) from 超级表 where time 2023-01-01T00:00:00.0000800 and time 2024-01-01T00:00:00.0000800;--当前时间范围内的数据量
taosdump -D 数据库 -o /home/taosdata -S 2023-01-01T00:00:00.0000800 -E 2024-01-01T00:00:00.0000800恢复当前导出的数据到另外一台TDengine测试时使用的是我本地的虚拟机中安装的TDengine
taosdump -u root -p 123456 -i /home/taosdata四、TDengine数据迁移完之后对比 迁移完成后可以通过查询超级表中的数据的总数量来验证。 select count(*) from stb_charging_working_data;
select count(*) from stb_cp_chargingparameter_rpt_data;