blob: adbc1f239d2b107675f2494d30639ec322880bc9 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{471:function(e,s,t){"use strict";t.r(s);var a=t(29),n=Object(a.a)({},(function(){var e=this,s=e._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"edge-cloud-collaboration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#edge-cloud-collaboration"}},[e._v("#")]),e._v(" Edge-Cloud Collaboration")]),e._v(" "),s("h2",{attrs:{id:"_1-introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-introduction"}},[e._v("#")]),e._v(" 1.Introduction")]),e._v(" "),s("p",[e._v("The Sync Tool is an IoTDB suite tool that continuously uploads the timeseries data from the edge (sender) to the cloud(receiver).")]),e._v(" "),s("p",[e._v("On the sender side of the sync, the sync module is embedded in the IoTDB engine. You should start an IoTDB before using the Sync tool.")]),e._v(" "),s("p",[e._v("You can use SQL commands to start or close a synchronization task at the sender, and you can check the status of the synchronization task at any time. At the receiving end, you can set the IP white list to specify the access IP address range of sender.")]),e._v(" "),s("h2",{attrs:{id:"_2-model-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-model-definition"}},[e._v("#")]),e._v(" 2.Model definition")]),e._v(" "),s("p",[s("img",{attrs:{src:"https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/System%20Tools/Sync-Tool/pipe2.png?raw=true",alt:"pipe2.png"}})]),e._v(" "),s("p",[e._v("Two machines A and B, which are installed with iotdb, we want to continuously synchronize the data from A to B. To better describe this process, we introduce the following concepts.")]),e._v(" "),s("ul",[s("li",[e._v("Pipe\n"),s("ul",[s("li",[e._v("It refers to a synchronization task. In the above case, we can see that there is a data flow pipeline connecting A and B.")]),e._v(" "),s("li",[e._v("A pipe has three states, RUNNING, STOP and DROP, which respectively indicate running, pause and permanent cancellation.")])])]),e._v(" "),s("li",[e._v("PipeSink\n"),s("ul",[s("li",[e._v("It refers to the receiving end. In the above case, pipesink is machine B. At present, the pipesink type only supports IoTDB, that is, the receiver is the IoTDB instance installed on B.")]),e._v(" "),s("li",[e._v("Pipeserver: when the type of pipesink is IoTDB, you need to open the pipeserver service of IoTDB to process the pipe data.")])])])]),e._v(" "),s("h2",{attrs:{id:"_3-precautions-for-use"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-precautions-for-use"}},[e._v("#")]),e._v(" 3.Precautions for Use")]),e._v(" "),s("ul",[s("li",[e._v("The Sync Tool only supports for many-to-one, that is, one sender should connect to exactly one receiver. One receiver can receive data from more senders.")]),e._v(" "),s("li",[e._v("The sender can only have one pipe in non drop status. If you want to create a new pipe, please drop the current pipe.")]),e._v(" "),s("li",[e._v("When one or more senders send data to a receiver, there should be no intersection between the respective device path sets of these senders and receivers, otherwise unexpected errors may occur.\n"),s("ul",[s("li",[e._v("e.g. When sender A includes path "),s("code",[e._v("root.sg.d.s")]),e._v(", sender B also includes the path "),s("code",[e._v("root.sg.d.s")]),e._v(", sender A deletes storage group "),s("code",[e._v("root.sg")]),e._v(" will also delete all data of B stored in the path "),s("code",[e._v("root.sg.d.s")]),e._v(" at receiver.")])])]),e._v(" "),s("li",[e._v("Synchronization between the two machines is not supported at present.")]),e._v(" "),s("li",[e._v("The Sync Tool only synchronizes insertions, deletions, metadata creations and deletions, do not support TTL settings, trigger and other operations.\n"),s("ul",[s("li",[e._v("If TTL is set on the sender side, all unexpired data in the IoTDB and all future data writes and deletions will be synchronized to the receiver side when Pipe is started.")])])])]),e._v(" "),s("h2",{attrs:{id:"_4-quick-start"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-quick-start"}},[e._v("#")]),e._v(" 4.Quick Start")]),e._v(" "),s("p",[e._v("Execute the following SQL statements at the sender and receiver to quickly start a data synchronization task between two IoTDB. For complete SQL statements and configuration matters, please see the "),s("code",[e._v("parameter configuration")]),e._v("and "),s("code",[e._v("SQL")]),e._v(" sections. For more usage examples, please refer to the "),s("code",[e._v("usage examples")]),e._v(" section.")]),e._v(" "),s("h3",{attrs:{id:"_4-1-receiver"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-receiver"}},[e._v("#")]),e._v(" 4.1 Receiver")]),e._v(" "),s("ul",[s("li",[e._v("Start PipeServer.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> START PIPESERVER\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Stop PipeServer(should execute after dropping all pipes which connect to this receiver).")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IOTDB> STOP PIPESERVER\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("h3",{attrs:{id:"_4-2-sender"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-sender"}},[e._v("#")]),e._v(" 4.2 Sender")]),e._v(" "),s("ul",[s("li",[e._v("Create a pipesink with IoTDB type.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> CREATE PIPESINK central_iotdb AS IoTDB (IP='There is your goal IP')\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Establish a pipe(before creation, ensure that PipeServer is running on receiver).")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> CREATE PIPE my_pipe TO central_iotDB\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Start this pipe.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> START PIPE my_pipe\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Show pipe's status.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> SHOW PIPES\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Stop this pipe.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> STOP PIPE my_pipe\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Continue this pipe.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> START PIPE my_pipe\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Drop this pipe(delete all information about this pipe).")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> DROP PIPE my_pipe\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("h2",{attrs:{id:"_5-parameter-configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-parameter-configuration"}},[e._v("#")]),e._v(" 5.Parameter Configuration")]),e._v(" "),s("p",[e._v("All parameters are in "),s("code",[e._v("$IOTDB_ HOME$/conf/iotdb-engine")]),e._v(", after all modifications are completed, execute "),s("code",[e._v("load configuration")]),e._v(" and it will take effect immediately.")]),e._v(" "),s("h3",{attrs:{id:"_5-1-sender"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-sender"}},[e._v("#")]),e._v(" 5.1 Sender")]),e._v(" "),s("table",[s("thead",[s("tr",[s("th",[s("strong",[e._v("Parameter Name")])]),e._v(" "),s("th",[s("strong",[e._v("max_number_of_sync_file_retry")])])])]),e._v(" "),s("tbody",[s("tr",[s("td",[e._v("Description")]),e._v(" "),s("td",[e._v("The maximum number of retries when the sender fails to synchronize files to the receiver.")])]),e._v(" "),s("tr",[s("td",[e._v("Data type")]),e._v(" "),s("td",[e._v("Int : [0,2147483647]")])]),e._v(" "),s("tr",[s("td",[e._v("Default value")]),e._v(" "),s("td",[e._v("5")])])])]),e._v(" "),s("h3",{attrs:{id:"_5-2-receiver"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-receiver"}},[e._v("#")]),e._v(" 5.2 Receiver")]),e._v(" "),s("table",[s("thead",[s("tr",[s("th",[s("strong",[e._v("Parameter Name")])]),e._v(" "),s("th",[s("strong",[e._v("ip_white_list")])])])]),e._v(" "),s("tbody",[s("tr",[s("td",[e._v("Description")]),e._v(" "),s("td",[e._v("Set the white list of IP addresses of the sending end of the synchronization, which is expressed in the form of network segments, and multiple network segments are separated by commas. When the sender synchronizes data to the receiver, the receiver allows synchronization only when the IP address of the sender is within the network segment set in the white list. If the whitelist is empty, the receiver does not allow any sender to synchronize data. By default, the receiving end accepts the synchronization request of all IP addresses.")])]),e._v(" "),s("tr",[s("td",[e._v("Data type")]),e._v(" "),s("td",[e._v("String")])]),e._v(" "),s("tr",[s("td",[e._v("Default value")]),e._v(" "),s("td",[e._v("0.0.0.0/0")])])])]),e._v(" "),s("table",[s("thead",[s("tr",[s("th",[s("strong",[e._v("Parameter Name")])]),e._v(" "),s("th",[s("strong",[e._v("sync_server_port")])])])]),e._v(" "),s("tbody",[s("tr",[s("td",[e._v("Description")]),e._v(" "),s("td",[e._v("The port which the receiver listens, please ensure this port is not occupied by other applications.")])]),e._v(" "),s("tr",[s("td",[e._v("Data type")]),e._v(" "),s("td",[e._v("Short Int : [0,65535]")])]),e._v(" "),s("tr",[s("td",[e._v("Default value")]),e._v(" "),s("td",[e._v("6670")])])])]),e._v(" "),s("h2",{attrs:{id:"_6-sql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-sql"}},[e._v("#")]),e._v(" 6.SQL")]),e._v(" "),s("h3",{attrs:{id:"_6-1-sender"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-sender"}},[e._v("#")]),e._v(" 6.1 Sender")]),e._v(" "),s("ul",[s("li",[e._v("Create a pipesink with IoTDB type, where IP and port are optional parameters.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> CREATE PIPESINK <PipeSinkName> AS IoTDB [(IP='127.0.0.1',port=6670);]\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Show all pipesink types supported by IoTDB.")])]),e._v(" "),s("div",{staticClass:"language-Plain%20Text line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> SHOW PIPESINKTYPE\nIoTDB>\n+-----+\n| type|\n+-----+\n|IoTDB|\n+-----+\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br"),s("span",{staticClass:"line-number"},[e._v("2")]),s("br"),s("span",{staticClass:"line-number"},[e._v("3")]),s("br"),s("span",{staticClass:"line-number"},[e._v("4")]),s("br"),s("span",{staticClass:"line-number"},[e._v("5")]),s("br"),s("span",{staticClass:"line-number"},[e._v("6")]),s("br"),s("span",{staticClass:"line-number"},[e._v("7")]),s("br")])]),s("ul",[s("li",[e._v("Show all pipesinks' definition, the results set has three columns, name, pipesink's type and pipesink's attributes.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> SHOW PIPESINKS\nIoTDB> SHOW PIPESINK [PipeSinkName]\nIoTDB> \n+-----------+-----+------------------------+\n| name| type| attributes|\n+-----------+-----+------------------------+\n|my_pipesink|IoTDB|ip='127.0.0.1',port=6670|\n+-----------+-----+------------------------+\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br"),s("span",{staticClass:"line-number"},[e._v("2")]),s("br"),s("span",{staticClass:"line-number"},[e._v("3")]),s("br"),s("span",{staticClass:"line-number"},[e._v("4")]),s("br"),s("span",{staticClass:"line-number"},[e._v("5")]),s("br"),s("span",{staticClass:"line-number"},[e._v("6")]),s("br"),s("span",{staticClass:"line-number"},[e._v("7")]),s("br"),s("span",{staticClass:"line-number"},[e._v("8")]),s("br")])]),s("ul",[s("li",[e._v("Drop the pipesink with PipeSinkName parameter.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> DROP PIPESINK <PipeSinkName>\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Create a pipe.")]),e._v(" "),s("li",[e._v("At present, the SELECT statement only supports "),s("code",[e._v("**")]),e._v(" (i.e. data in all timeseries), the FROM statement only supports "),s("code",[e._v("root")]),e._v(", and the WHERE statement only supports the start time of the specified time.")]),e._v(" "),s("li",[e._v("If the "),s("code",[e._v("SyncDelOp")]),e._v(" parameter is true, the deletions of sender will not be synchronized to receiver.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> CREATE PIPE my_pipe TO my_iotdb [FROM (select ** from root WHERE time>='yyyy-mm-dd HH:MM:SS' )] [WITH SyncDelOp=true]\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Show all pipes' status.")])]),e._v(" "),s("blockquote",[s("p",[e._v("This statement can be executed on both senders and receivers.")])]),e._v(" "),s("ul",[s("li",[s("p",[e._v("Create time, the creation time of this pipe.")])]),e._v(" "),s("li",[s("p",[e._v("Name, the name of this pipe.")])]),e._v(" "),s("li",[s("p",[e._v("Role, the current role of this IoTDB in pipe, there are two possible roles.")]),e._v(" "),s("ul",[s("li",[e._v("Sender, the current IoTDB is the synchronous sender")]),e._v(" "),s("li",[e._v("Receiver, the current IoTDB is the synchronous receiver")])])]),e._v(" "),s("li",[s("p",[e._v("Remote, information about the opposite end of the pipe.")]),e._v(" "),s("ul",[s("li",[e._v("When role is receiver, the value of this field is the sender's IP.")]),e._v(" "),s("li",[e._v("When role is sender, the value of this field is the pipeSink name.")])])]),e._v(" "),s("li",[s("p",[e._v("Status, this pipe's status.")])]),e._v(" "),s("li",[s("p",[e._v("Message, the status message of this pipe. When pipe runs normally, this column is usually empty. When an exception occurs, messages may appear in following two states.")]),e._v(" "),s("ul",[s("li",[e._v("WARN, this indicates that a data loss or other error has occurred, but the pipe will remain running.")]),e._v(" "),s("li",[e._v("ERROR, this indicates that the network is interrupted for a long time or there is a problem at the receiving end. The pipe is stopped and set to STOP state.")])])])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> SHOW PIPES\nIoTDB>\n+-----------------------+--------+--------+-------------+---------+-------+\n| create time| name | role| remote| status|message|\n+-----------------------+--------+--------+-------------+---------+-------+\n|2022-03-30T20:58:30.689|my_pipe1| sender| my_pipesink| STOP| |\n+-----------------------+--------+--------+-------------+---------+-------+ \n|2022-03-31T12:55:28.129|my_pipe2|receiver|192.168.11.11| RUNNING| |\n+-----------------------+--------+--------+-------------+---------+-------+\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br"),s("span",{staticClass:"line-number"},[e._v("2")]),s("br"),s("span",{staticClass:"line-number"},[e._v("3")]),s("br"),s("span",{staticClass:"line-number"},[e._v("4")]),s("br"),s("span",{staticClass:"line-number"},[e._v("5")]),s("br"),s("span",{staticClass:"line-number"},[e._v("6")]),s("br"),s("span",{staticClass:"line-number"},[e._v("7")]),s("br"),s("span",{staticClass:"line-number"},[e._v("8")]),s("br"),s("span",{staticClass:"line-number"},[e._v("9")]),s("br")])]),s("ul",[s("li",[e._v("Show the pipe status with PipeName. When the PipeName is empty,it is the same with "),s("code",[e._v("Show PIPES")]),e._v(".")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> SHOW PIPE [PipeName]\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Stop the pipe with PipeName.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> STOP PIPE <PipeName>\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Continue the pipe with PipeName.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> START PIPE <PipeName>\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Drop the pipe with PipeName(delete all information about this pipe).")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> DROP PIPE <PipeName>\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("h4",{attrs:{id:"_6-2-receiver"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-receiver"}},[e._v("#")]),e._v(" 6.2 Receiver")]),e._v(" "),s("ul",[s("li",[e._v("Start the PipeServer service.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> START PIPESERVER\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Stop the PipeServer service.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> STOP PIPESERVER\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Show the information of PipeServer.\n"),s("ul",[s("li",[e._v("True means the PipeServer is running, otherwise not.")])])])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> SHOW PIPESERVER STATUS\n+----------+\n| enalbe|\n+----------+\n|true/false|\n+----------+\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br"),s("span",{staticClass:"line-number"},[e._v("2")]),s("br"),s("span",{staticClass:"line-number"},[e._v("3")]),s("br"),s("span",{staticClass:"line-number"},[e._v("4")]),s("br"),s("span",{staticClass:"line-number"},[e._v("5")]),s("br"),s("span",{staticClass:"line-number"},[e._v("6")]),s("br")])]),s("h2",{attrs:{id:"_7-usage-examples"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-usage-examples"}},[e._v("#")]),e._v(" 7. Usage Examples")]),e._v(" "),s("h5",{attrs:{id:"goal"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#goal"}},[e._v("#")]),e._v(" Goal")]),e._v(" "),s("ul",[s("li",[e._v("Create a synchronize task from sender IoTDB to receiver IoTDB.")]),e._v(" "),s("li",[e._v("Sender wants to synchronize the data after 2022-3-30 00:00:00.")]),e._v(" "),s("li",[e._v("Sender does not want to synchronize the deletions.")]),e._v(" "),s("li",[e._v("Sender has an unstable network environment, needs more retries.")]),e._v(" "),s("li",[e._v("Receiver only wants to receive data from this sender(sender ip 192.168.0.1).")])]),e._v(" "),s("h5",{attrs:{id:"receiver"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#receiver"}},[e._v("#")]),e._v(" "),s("strong",[e._v("Receiver")])]),e._v(" "),s("ul",[s("li",[s("code",[e._v("vi conf/iotdb-datanode.properties")]),e._v(" to config the parameters,set the IP white list to 192.168.0.1/1 to receive and only receive data from sender.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("####################\n### PIPE Server Configuration\n####################\n# PIPE server port to listen\n# Datatype: int\n# pipe_server_port=6670\n\n# White IP list of Sync client.\n# Please use the form of network segment to present the range of IP, for example: 192.168.0.0/16\n# If there are more than one IP segment, please separate them by commas\n# The default is to allow all IP to sync\n# Datatype: String\nip_white_list=192.168.0.1/1\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br"),s("span",{staticClass:"line-number"},[e._v("2")]),s("br"),s("span",{staticClass:"line-number"},[e._v("3")]),s("br"),s("span",{staticClass:"line-number"},[e._v("4")]),s("br"),s("span",{staticClass:"line-number"},[e._v("5")]),s("br"),s("span",{staticClass:"line-number"},[e._v("6")]),s("br"),s("span",{staticClass:"line-number"},[e._v("7")]),s("br"),s("span",{staticClass:"line-number"},[e._v("8")]),s("br"),s("span",{staticClass:"line-number"},[e._v("9")]),s("br"),s("span",{staticClass:"line-number"},[e._v("10")]),s("br"),s("span",{staticClass:"line-number"},[e._v("11")]),s("br"),s("span",{staticClass:"line-number"},[e._v("12")]),s("br"),s("span",{staticClass:"line-number"},[e._v("13")]),s("br")])]),s("ul",[s("li",[e._v("Start PipeServer service at receiver.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> START PIPESERVER\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Show PipeServer's status, a "),s("code",[e._v("True")]),e._v(" result means running correctly.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> SHOW PIPESERVER STATUS\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("h5",{attrs:{id:"sender"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sender"}},[e._v("#")]),e._v(" Sender")]),e._v(" "),s("ul",[s("li",[e._v("Config the "),s("code",[e._v("max_number_of_sync_file_retry")]),e._v(" parameter to 10.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("####################\n### PIPE Sender Configuration\n####################\n# The maximum number of retry when syncing a file to receiver fails.\nmax_number_of_sync_file_retry=10\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br"),s("span",{staticClass:"line-number"},[e._v("2")]),s("br"),s("span",{staticClass:"line-number"},[e._v("3")]),s("br"),s("span",{staticClass:"line-number"},[e._v("4")]),s("br"),s("span",{staticClass:"line-number"},[e._v("5")]),s("br")])]),s("ul",[s("li",[e._v("Create pipesink with IoTDB type, input ip address 192.168.0.1, port 6670.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> CREATE PIPESINK my_iotdb AS IoTDB (IP='192.168.0.2',PORT=6670)\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Create pipe connect to my_iotdb, input the start time 2022-03-30 00:00:00 in WHERE statments, set the "),s("code",[e._v("SyncDelOp")]),e._v(" to false.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> CREATE PIPE p TO my_iotdb FROM (select ** from root where time>='2022-03-30 00:00:00') WITH SyncDelOp=false\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Start the pipe p")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> START PIPE p\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Show the status of pipe p.")])]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> SHOW PIPE p\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("h5",{attrs:{id:"result-verification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#result-verification"}},[e._v("#")]),e._v(" Result Verification")]),e._v(" "),s("p",[e._v("Execute SQL on sender.")]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("SET STORAGE GROUP TO root.vehicle;\nCREATE TIMESERIES root.vehicle.d0.s0 WITH DATATYPE=INT32, ENCODING=RLE;\nCREATE TIMESERIES root.vehicle.d0.s1 WITH DATATYPE=TEXT, ENCODING=PLAIN;\nCREATE TIMESERIES root.vehicle.d1.s2 WITH DATATYPE=FLOAT, ENCODING=RLE;\nCREATE TIMESERIES root.vehicle.d1.s3 WITH DATATYPE=BOOLEAN, ENCODING=PLAIN;\ninsert into root.vehicle.d0(timestamp,s0) values(now(),10);\ninsert into root.vehicle.d0(timestamp,s0,s1) values(now(),12,'12');\ninsert into root.vehicle.d0(timestamp,s1) values(now(),'14');\ninsert into root.vehicle.d1(timestamp,s2) values(now(),16.0);\ninsert into root.vehicle.d1(timestamp,s2,s3) values(now(),18.0,true);\ninsert into root.vehicle.d1(timestamp,s3) values(now(),false);\nflush;\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br"),s("span",{staticClass:"line-number"},[e._v("2")]),s("br"),s("span",{staticClass:"line-number"},[e._v("3")]),s("br"),s("span",{staticClass:"line-number"},[e._v("4")]),s("br"),s("span",{staticClass:"line-number"},[e._v("5")]),s("br"),s("span",{staticClass:"line-number"},[e._v("6")]),s("br"),s("span",{staticClass:"line-number"},[e._v("7")]),s("br"),s("span",{staticClass:"line-number"},[e._v("8")]),s("br"),s("span",{staticClass:"line-number"},[e._v("9")]),s("br"),s("span",{staticClass:"line-number"},[e._v("10")]),s("br"),s("span",{staticClass:"line-number"},[e._v("11")]),s("br"),s("span",{staticClass:"line-number"},[e._v("12")]),s("br")])]),s("p",[e._v("Execute SELECT statements, the same results can be found on sender and receiver.")]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("IoTDB> select ** from root.vehicle\n+-----------------------------+------------------+------------------+------------------+------------------+\n| Time|root.vehicle.d0.s0|root.vehicle.d0.s1|root.vehicle.d1.s3|root.vehicle.d1.s2|\n+-----------------------------+------------------+------------------+------------------+------------------+\n|2022-04-03T20:08:17.127+08:00| 10| null| null| null|\n|2022-04-03T20:08:17.358+08:00| 12| 12| null| null|\n|2022-04-03T20:08:17.393+08:00| null| 14| null| null|\n|2022-04-03T20:08:17.538+08:00| null| null| null| 16.0|\n|2022-04-03T20:08:17.753+08:00| null| null| true| 18.0|\n|2022-04-03T20:08:18.263+08:00| null| null| false| null|\n+-----------------------------+------------------+------------------+------------------+------------------+\nTotal line number = 6\nIt costs 0.134s\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br"),s("span",{staticClass:"line-number"},[e._v("2")]),s("br"),s("span",{staticClass:"line-number"},[e._v("3")]),s("br"),s("span",{staticClass:"line-number"},[e._v("4")]),s("br"),s("span",{staticClass:"line-number"},[e._v("5")]),s("br"),s("span",{staticClass:"line-number"},[e._v("6")]),s("br"),s("span",{staticClass:"line-number"},[e._v("7")]),s("br"),s("span",{staticClass:"line-number"},[e._v("8")]),s("br"),s("span",{staticClass:"line-number"},[e._v("9")]),s("br"),s("span",{staticClass:"line-number"},[e._v("10")]),s("br"),s("span",{staticClass:"line-number"},[e._v("11")]),s("br"),s("span",{staticClass:"line-number"},[e._v("12")]),s("br"),s("span",{staticClass:"line-number"},[e._v("13")]),s("br")])]),s("h2",{attrs:{id:"_8-q-a"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_8-q-a"}},[e._v("#")]),e._v(" 8.Q&A")]),e._v(" "),s("ul",[s("li",[s("p",[e._v("Execute")]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("STOP PIPESERVER\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("p",[e._v("to close IoTDB PipeServer service with message.")]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Msg: 328: Failed to stop pipe server because there is pipe still running.\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Cause by: There is a running pipe connected to this receiver.")]),e._v(" "),s("li",[e._v("Solution: Execute "),s("code",[e._v("STOP PIPE <PipeName>")]),e._v(" to stop pipe, then stop PipeServer service.")])])]),e._v(" "),s("li",[s("p",[e._v("Execute")]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("CREATE PIPE mypipe\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("p",[e._v("get message.")]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Msg: 411: Create transport for pipe mypipe error, because CREATE request connects to receiver 127.0.0.1:6670 error..\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Cause by: The receiver is not started or the receiver cannot be connected.")]),e._v(" "),s("li",[e._v("Solution: Execute "),s("code",[e._v("SHOW PIPESERVER")]),e._v(" on the receiver side to check if the receiver side is started, if not use "),s("code",[e._v("START PIPESERVER")]),e._v(" to start; check if the whitelist in "),s("code",[e._v("iotdb-datanode.properties")]),e._v(" on the receiver side contains the sender ip.")])])]),e._v(" "),s("li",[s("p",[e._v("Execute")]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("DROP PIPESINK pipesinkName\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("p",[e._v("get message.")]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Msg: 411: Can not drop pipeSink demo, because pipe mypipe is using it.\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Cause by: It is not allowed to delete PipeSink that is used by a running PIPE.")]),e._v(" "),s("li",[e._v("Solution: Execute "),s("code",[e._v("SHOW PIPE")]),e._v(" on the sender side to stop using the PipeSink's PIPE.")])])]),e._v(" "),s("li",[s("p",[e._v("Sender creates PIPE prompt.")]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Msg: 411: Pipe p is RUNNING, please retry after drop it.\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("ul",[s("li",[e._v("Cause by: There is already a running PIPE.")]),e._v(" "),s("li",[e._v("Solution: Execute "),s("code",[e._v("DROP PIPE p")]),e._v(" and retry.")])])])])])}),[],!1,null,null,null);s.default=n.exports}}]);