大约 2 分钟

Mlog 加载工具

工具介绍

MLogLoad 工具用于将重放 mlog.bin 中和 tlog.txt 中的元数据操作,将元数据信息加载到正在运行的 IoTDB 中。 与正在运行的 IoTDB 中的元数据存在冲突的待加载数据将会被跳过。

若正在运行的 IoTDB 中已有元数据,为避免重放删除操作影响元数据,建议使用 导出元数据操作open in new window 归档得到的 mlog.bintlog.txt 进行增量加载。

使用方法

Linux/MacOS

./mLogLoad.sh -mlog /yourpath/mlog.bin -tlog /yourpath/tlog.txt -h 127.0.0.1 -p 6667 -u root -pw root

Windows

./mLogLoad.bat -mlog /yourpath/mlog.bin -tlog /yourpath/tlog.txt -h 127.0.0.1 -p 6667 -u root -pw root

usage: MLogLoad -mlog <mlog file> [-tlog <tlog file>] [-h <receiver host>]
       [-p <receiver port>] [-u <user>] [-pw <password>] [-help]
 -mlog <mlog file>    Need to specify a binary mlog.bin file to parse
                      (required)
 -tlog <tlog file>    Could specify a binary tlog.txt file to parse. Tags
                      and attributes will be ignored if not specified
                      (optional)
 -h <receiver host>   Could specify a specify the receiver host, default
                      is 127.0.0.1 (optional)
 -p <receiver port>   Could specify a specify the receiver port, default
                      is 6667 (optional)
 -u <user>            Could specify the user name, default is root
                      (optional)
 -pw <password>       Could specify the password, default is root
                      (optional)
 -help,--help         Display help information

注意:当 tlog 未指定时,Mlog 加载工具会跳过标签点管理相关的元数据操作。

使用示例

假定服务器 192.168.0.101:6667 上运行一个 IoTDB 实例,想从将本地的元数据文件 /yourpath/mlog.bin 加载进此IoTDB实例。

进入到 mLogLoad.shopen in new window 所在文件夹中,执行如下语句:

./mLogLoad.sh -f "/yourpath/mlog.bin" -h 192.168.0.101 -p 6667 -u root -pw root

等待脚本执行完成之后,可以检查 IoTDB 实例中元数据已经被正确加载。

常见问题

  • 找不到或无法加载主类 MLogLoader
    • 可能是由于未设置环境变量 $IOTDB_HOME,请设置环境变量之后重试

Copyright © 2023 The Apache Software Foundation.
Apache and the Apache feather logo are trademarks of The Apache Software Foundation

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

We use Google Analytics to collect anonymous, aggregated usage information.