跳至主要內容

...大约 2 分钟

元数据导出操作

元数据导出操作会以 mlog.bin 和 tlog.txt 的形式将当前 IoTDB 中的存储组、时间序列、元数据模板信息进行归档,并导出到指定目录中。

导出的 mlog.bin 和 tlog.txt 文件可以增量的方式加载到已有元数据的 IoTDB 实例中。

使用 SQL 方式导出元数据

元数据导出的 SQL 语句如下所示:

EXPORT SCHEMA '<path/dir>' 

使用脚本方式导出元数据

Linux/MacOS

./exportSchema.sh -o /yourpath/targetDir -h 127.0.0.1 -p 6667 -u root -pw root

Windows

./exportSchema.bat -o /yourpath/targetDir -h 127.0.0.1 -p 6667 -u root -pw root

使用脚本方式导出元数据时候,需要指定 IoTDB 元数据文件的导出目标目录(位于 IoTDB 服务器),注意导出目标目录必须为绝对路径。

usage: ExportSchema -o <target directory path> [-h <host address>] [-p <port>] [-u <user>] [-pw <password>] [-help]
 -o <target directory path>   Need to specify a absolute target directory
                              path on server(required)
 -h <host address>            Could specify a specify the IoTDB host
                              address, default is 127.0.0.1 (optional)
 -p <port>                    Could specify a specify the IoTDB port,
                              default is 6667 (optional)
 -u <user>                    Could specify the IoTDB user name, default
                              is root (optional)
 -pw <password>               Could specify the IoTDB password, default is
                              root (optional)
 -help,--help                 Display help information

常见问题

  • 找不到或无法加载主类 ExportSchema
    • 可能是由于未设置环境变量 $IOTDB_HOME,请设置环境变量之后重试
  • Encounter an error, because: File ... already exist.
    • 目标目录下已有 mlog.bin 或者 tlog.txt 文件,请检查目标目录之后重试

元数据加载操作

参考 MLog 加载工具open in new window

Copyright © 2024 The Apache Software Foundation.
Apache IoTDB, IoTDB, Apache, the Apache feather logo, and the Apache IoTDB project logo are either registered trademarks or trademarks of The Apache Software Foundation in all countries

Have a question? Connect with us on QQ, WeChat, or Slack. Join the community now.