blob: 66800c87a39a7a63955f9c45b3eb7a9b5ac22cf4 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{472:function(t,e,a){"use strict";a.r(e);var s=a(29),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"iotdb-rewrite-tsfile-tool"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#iotdb-rewrite-tsfile-tool"}},[t._v("#")]),t._v(" IoTDB Rewrite-TsFile Tool")]),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("The Rewrite-TsFile tool is used to write the data in TsFile to the running IoTDB.")]),t._v(" "),e("h2",{attrs:{id:"how-to-use"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#how-to-use"}},[t._v("#")]),t._v(" How to use")]),t._v(" "),e("p",[t._v("Run rewrite-tsfile.bat if you are in a Windows environment, or rewrite-tsfile.sh if you are on Linux or Unix.")]),t._v(" "),e("div",{staticClass:"language-bash line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("./rewrite-tsfile.bat -f filePath "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("-h host"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("-help"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("-p port"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("-pw password"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" -u user\n-f File or Dictionary to be loaded.\n-h Host Name "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("optional, default "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("127.0")]),t._v(".0.1"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n-help Display "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" information"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("optional"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n-p Port "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("optional, default "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("6667")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n-pw password "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("optional"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n-u User name "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("required"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])]),t._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[t._v("1")]),e("br"),e("span",{staticClass:"line-number"},[t._v("2")]),e("br"),e("span",{staticClass:"line-number"},[t._v("3")]),e("br"),e("span",{staticClass:"line-number"},[t._v("4")]),e("br"),e("span",{staticClass:"line-number"},[t._v("5")]),e("br"),e("span",{staticClass:"line-number"},[t._v("6")]),e("br"),e("span",{staticClass:"line-number"},[t._v("7")]),e("br")])]),e("h2",{attrs:{id:"example"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[t._v("#")]),t._v(" Example")]),t._v(" "),e("p",[t._v("Assuming that an IoTDB instance is running on server 192.168.0.101:6667, you want to load all TsFile files from the locally saved TsFile backup folder D:\\IoTDB\\data into this IoTDB instance.")]),t._v(" "),e("p",[t._v("First move to the folder where rewrite-tsfile.bat is located, open the command line, and execute")]),t._v(" "),e("div",{staticClass:"language-bash line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("./load-rewrite.bat -f "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"D:\\IoTDB\\data"')]),t._v(" -h "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("192.168")]),t._v(".0.101 -p "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("6667")]),t._v(" -u root -pw root\n")])]),t._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[t._v("1")]),e("br")])]),e("p",[t._v("After waiting for the script execution to complete, you can check that the data in the IoTDB instance has been loaded correctly.")]),t._v(" "),e("h2",{attrs:{id:"q-a"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#q-a"}},[t._v("#")]),t._v(" Q&A")]),t._v(" "),e("ul",[e("li",[t._v("Cannot find or load the main class RewriteTsFileTool\n"),e("ul",[e("li",[t._v("It may be because the environment variable $IOTDB_HOME is not set, please set the environment variable and try again")])])]),t._v(" "),e("li",[t._v("Missing require argument: f or Missing require argument: u\n"),e("ul",[e("li",[t._v("The input command is missing the -f field (file or folder path to be loaded) or the -u field (user name), please add it and re-execute")])])]),t._v(" "),e("li",[t._v("What if the execution crashes in the middle and you want to reload?\n"),e("ul",[e("li",[t._v("The easiest way, you re-execute the command just now, reloading the data will not affect the correctness after loading")]),t._v(" "),e("li",[t._v("If you want to save time by avoiding reloading a file that has already been loaded, you can remove the TsFile that the last execution log shows has been loaded from the pending folder and reload that folder")])])])])])}),[],!1,null,null,null);e.default=n.exports}}]);