blob: daf32f2a188a55de603cb4bbc5701cc9cfdce80e [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[259],{655: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("h2",{attrs:{id:"way-to-get-iotdb-binary-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#way-to-get-iotdb-binary-files"}},[t._v("#")]),t._v(" Way to get IoTDB binary files")]),t._v(" "),e("p",[t._v("IoTDB provides you three installation methods, you can refer to the following suggestions, choose one of them:")]),t._v(" "),e("ul",[e("li",[t._v("Installation from source code. If you need to modify the code yourself, you can use this method.")]),t._v(" "),e("li",[t._v("Installation from binary files. Download the binary files from the official website. This is the recommended method, in which you will get a binary released package which is out-of-the-box.")]),t._v(" "),e("li",[t._v("Using Docker:The path to the dockerfile is https://github.com/apache/iotdb/blob/master/docker/Dockerfile")])]),t._v(" "),e("h3",{attrs:{id:"prerequisites"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[t._v("#")]),t._v(" Prerequisites")]),t._v(" "),e("p",[t._v("To use IoTDB, you need to have:")]),t._v(" "),e("ol",[e("li",[t._v("Java >= 1.8 (Please make sure the environment path has been set)")]),t._v(" "),e("li",[t._v("Maven >= 3.6 (Optional)")]),t._v(" "),e("li",[t._v('Set the max open files num as 65535 to avoid "too many open files" problem.')])]),t._v(" "),e("blockquote",[e("p",[t._v("Note: If you don't have maven installed, you should replace 'mvn' in the following commands with 'mvnw.sh' or 'mvnw.cmd'.")]),t._v(" "),e("h3",{attrs:{id:"installation-from-binary-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#installation-from-binary-files"}},[t._v("#")]),t._v(" Installation from binary files")])]),t._v(" "),e("p",[t._v("You can download the binary file from:\n"),e("a",{attrs:{href:"https://iotdb.apache.org/Download/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Download page"),e("OutboundLink")],1)]),t._v(" "),e("h3",{attrs:{id:"installation-from-source-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#installation-from-source-code"}},[t._v("#")]),t._v(" Installation from source code")]),t._v(" "),e("p",[t._v("You can get the released source code from https://iotdb.apache.org/Download/, or from the git repository https://github.com/apache/iotdb/tree/master\nYou can download the source code from:")]),t._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("git clone https://github.com/apache/iotdb.git\n")])]),t._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[t._v("1")]),e("br")])]),e("p",[t._v("Under the root path of iotdb:")]),t._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("> mvn clean package -DskipTests\n")])]),t._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[t._v("1")]),e("br")])]),e("p",[t._v("Then the binary version (including both server and client) can be found at "),e("strong",[t._v("distribution/target/apache-iotdb-{project.version}-bin.zip")])]),t._v(" "),e("blockquote",[e("p",[t._v('NOTE: Directories "thrift/target/generated-sources/thrift" and "antlr/target/generated-sources/antlr4" need to be added to sources roots to avoid compilation errors in IDE.')])]),t._v(" "),e("p",[t._v("If you would like to build the IoTDB server, you can run the following command under the root path of iotdb:")]),t._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("> mvn clean package -pl server -am -DskipTests\n")])]),t._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[t._v("1")]),e("br")])]),e("p",[t._v('After build, the IoTDB server will be at the folder "server/target/iotdb-server-{project.version}".')]),t._v(" "),e("h3",{attrs:{id:"installation-by-docker-dockerfile"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#installation-by-docker-dockerfile"}},[t._v("#")]),t._v(" Installation by Docker (Dockerfile)")]),t._v(" "),e("p",[t._v("Apache IoTDB' Docker image is released on "),e("a",{attrs:{href:"https://hub.docker.com/r/apache/iotdb",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://hub.docker.com/r/apache/iotdb"),e("OutboundLink")],1),t._v(",\nUsing "),e("code",[t._v("docker pull apache/iotdb:latest")]),t._v(" can get the latest docker image.")]),t._v(" "),e("p",[t._v("Users can also build a docker image themselves.")]),t._v(" "),e("p",[t._v("Now a Dockerfile has been written at docker/src/main/Dockerfile.")]),t._v(" "),e("ol",[e("li",[t._v("You can build a docker image by:")])]),t._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" build -t iotdb:base git://github.com/apache/iotdb"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("#master:docker")]),t._v("\n")])]),t._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[t._v("1")]),e("br")])]),e("p",[t._v("Or:")]),t._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("git")]),t._v(" clone https://github.com/apache/iotdb\n$ "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" iotdb\n$ "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v("\n$ "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" build -t iotdb:base "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[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("p",[t._v("Once the docker image has been built locally (the tag is iotdb:base in this example), you are almost done!")]),t._v(" "),e("ol",{attrs:{start:"2"}},[e("li",[t._v("create docker volume for data files and logs:")])]),t._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" volume create mydata\n$ "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" volume create mylogs\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("ol",{attrs:{start:"3"}},[e("li",[t._v("run a docker container:")])]),t._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" run -p "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("6667")]),t._v(":6667 -v mydata:/iotdb/data -v mylogs:/iotdb/logs -d iotdb:base /iotdb/bin/start-server.sh\n")])]),t._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[t._v("1")]),e("br")])]),e("p",[t._v("If success, you can run "),e("code",[t._v("docker ps")]),t._v(", and get something like the following:")]),t._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n2a68b6944cb5 iotdb:base "/iotdb/bin/start-se…" 4 minutes ago Up 5 minutes 0.0.0.0:6667->6667/tcp laughing_meitner\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("p",[t._v("You can use the above command to get the container ID:")]),t._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" container "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("ls")]),t._v("\n")])]),t._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[t._v("1")]),e("br")])]),e("p",[t._v("suppose the ID is <C_ID>.")]),t._v(" "),e("p",[t._v("And get the docker IP by:")]),t._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" inspect --format"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'{{.NetworkSettings.IPAddress}}'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("C_ID"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])]),t._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[t._v("1")]),e("br")])]),e("p",[t._v("suppose the IP is <C_IP>.")]),t._v(" "),e("ol",{attrs:{start:"4"}},[e("li",[t._v("If you just want to have a try by using iotdb-cli, you can:")])]),t._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("exec")]),t._v(" -it /bin/bash "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("C_ID"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n$ "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("now you have enter the container"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(": /cli/sbin/start-cli.sh -h localhost -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("span",{staticClass:"line-number"},[t._v("2")]),e("br")])]),e("p",[t._v("Or, run a new docker container as the client:")]),t._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" run -it iotdb:base /cli/sbin/start-cli.sh -h "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("C_IP"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" -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("Or, if you have a iotdb-cli locally (e.g., you have compiled the source code by "),e("code",[t._v("mvn package")]),t._v("), and suppose your work_dir is cli/bin, then you can just run:")]),t._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("$ start-cli.sh -h localhost -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("ol",{attrs:{start:"5"}},[e("li",[t._v("If you want to write codes to insert data and query data, please add the following dependence:")])]),t._v(" "),e("div",{staticClass:"language-xml line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-xml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("dependency")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("groupId")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("org.apache.iotdb"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("groupId")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("artifactId")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("iotdb-jdbc"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("artifactId")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("version")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("0.10.0"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("version")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("dependency")]),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("p",[t._v("Some examples about how to use IoTDB with IoTDB-JDBC can be found at: https://github.com/apache/iotdb/tree/master/example/jdbc/src/main/java/org/apache/iotdb")]),t._v(" "),e("ol",{attrs:{start:"6"}},[e("li",[t._v("Now enjoy it!")])])])}),[],!1,null,null,null);e.default=n.exports}}]);