blob: e51875c9322a0d83c463ef71d9ba7c2dd1ea1aad [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[105],{505:function(e,t,a){"use strict";a.r(t);var s=a(29),n=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h2",{attrs:{id:"way-to-get-iotdb-binary-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#way-to-get-iotdb-binary-files"}},[e._v("#")]),e._v(" Way to get IoTDB binary files")]),e._v(" "),t("p",[e._v("IoTDB provides you three installation methods, you can refer to the following suggestions, choose one of them:")]),e._v(" "),t("ul",[t("li",[e._v("Installation from source code. If you need to modify the code yourself, you can use this method.")]),e._v(" "),t("li",[e._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.")]),e._v(" "),t("li",[e._v("Using Docker:The path to the dockerfile is https://github.com/apache/iotdb/blob/master/docker/Dockerfile")])]),e._v(" "),t("h3",{attrs:{id:"prerequisites"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[e._v("#")]),e._v(" Prerequisites")]),e._v(" "),t("p",[e._v("To use IoTDB, you need to have:")]),e._v(" "),t("ol",[t("li",[e._v("Java >= 1.8 (Please make sure the environment path has been set)")]),e._v(" "),t("li",[e._v("Maven >= 3.6 (Optional)")]),e._v(" "),t("li",[e._v('Set the max open files num as 65535 to avoid "too many open files" problem.')])]),e._v(" "),t("blockquote",[t("p",[e._v("Note: If you don't have maven installed, you should replace 'mvn' in the following commands with 'mvnw.sh' or 'mvnw.cmd'.")]),e._v(" "),t("h3",{attrs:{id:"installation-from-binary-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installation-from-binary-files"}},[e._v("#")]),e._v(" Installation from binary files")])]),e._v(" "),t("p",[e._v("You can download the binary file from:\n"),t("a",{attrs:{href:"https://iotdb.apache.org/Download/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Download page"),t("OutboundLink")],1)]),e._v(" "),t("h3",{attrs:{id:"installation-from-source-code"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installation-from-source-code"}},[e._v("#")]),e._v(" Installation from source code")]),e._v(" "),t("p",[e._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:")]),e._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("git clone https://github.com/apache/iotdb.git\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br")])]),t("p",[e._v("After that, go to the root path of IoTDB. If you want to build the version that we have released, you need to create and check out a new branch by command "),t("code",[e._v("git checkout -b my_{project.version} v{project.version}")]),e._v(". E.g., you want to build the version "),t("code",[e._v("0.12.4")]),e._v(", you can execute this command to make it:")]),e._v(" "),t("div",{staticClass:"language-shell line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("git")]),e._v(" checkout -b my_0.12.4 v0.12.4\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br")])]),t("p",[e._v("Then you can execute this command to build the version that you want:")]),e._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("> mvn clean package -DskipTests\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br")])]),t("p",[e._v("Then the binary version (including both server and client) can be found at "),t("strong",[e._v("distribution/target/apache-iotdb-{project.version}-bin.zip")])]),e._v(" "),t("blockquote",[t("p",[e._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.')])]),e._v(" "),t("p",[e._v("If you would like to build the IoTDB server, you can run the following command under the root path of iotdb:")]),e._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("> mvn clean package -pl server -am -DskipTests\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br")])]),t("p",[e._v('After build, the IoTDB server will be at the folder "server/target/iotdb-server-{project.version}".')]),e._v(" "),t("p",[e._v("If you would like to build a module, you can execute command "),t("code",[e._v("mvn clean package -pl {module.name} -am -DskipTests")]),e._v(" under the root path of IoTDB.\nIf you need the jar with dependencies, you can add parameter "),t("code",[e._v("-P get-jar-with-dependencies")]),e._v(" after the command. E.g., If you need the jar of jdbc with dependencies, you can execute this command:")]),e._v(" "),t("div",{staticClass:"language-shell line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v(" mvn clean package -pl jdbc -am -DskipTests -P get-jar-with-dependencies\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br")])]),t("p",[e._v("Then you can find it under the path "),t("code",[e._v("{module.name}/target")]),e._v(".")]),e._v(" "),t("h3",{attrs:{id:"installation-by-docker-dockerfile"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installation-by-docker-dockerfile"}},[e._v("#")]),e._v(" Installation by Docker (Dockerfile)")]),e._v(" "),t("p",[e._v("Apache IoTDB' Docker image is released on "),t("a",{attrs:{href:"https://hub.docker.com/r/apache/iotdb",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://hub.docker.com/r/apache/iotdb"),t("OutboundLink")],1),e._v(",")]),e._v(" "),t("ol",[t("li",[t("strong",[e._v("Get IoTDB docker image")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Recommended:")]),e._v(" Using "),t("code",[e._v("docker pull apache/iotdb:latest")]),e._v(" can get the latest docker image.")]),e._v(" "),t("li",[e._v("Users can also build a docker image themselves. Now a Dockerfile has been written at docker/src/main/Dockerfile.\n"),t("ul",[t("li",[e._v("Way 1: "),t("code",[e._v("$ docker build -t iotdb:base git://github.com/apache/iotdb#master:docker")])]),e._v(" "),t("li",[e._v("Way 2:")])]),e._v(" "),t("div",{staticClass:"language-shell line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v(" $ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("git")]),e._v(" clone https://github.com/apache/iotdb\n $ "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v("cd")]),e._v(" iotdb\n $ "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v("cd")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("docker")]),e._v("\n $ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("docker")]),e._v(" build -t iotdb:base "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(".")]),e._v("\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br"),t("span",{staticClass:"line-number"},[e._v("2")]),t("br"),t("span",{staticClass:"line-number"},[e._v("3")]),t("br"),t("span",{staticClass:"line-number"},[e._v("4")]),t("br")])])])])])]),e._v(" "),t("p",[e._v("Once the docker image has been built locally (the tag is iotdb:base in this example), you are almost done!")]),e._v(" "),t("ol",{attrs:{start:"2"}},[t("li",[t("strong",[e._v("Create docker volume for data files and logs:")])])]),e._v(" "),t("div",{staticClass:"language-shell line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("docker")]),e._v(" volume create mydata\n$ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("docker")]),e._v(" volume create mylogs\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br"),t("span",{staticClass:"line-number"},[e._v("2")]),t("br")])]),t("ol",{attrs:{start:"3"}},[t("li",[t("strong",[e._v("Run a docker container:")])])]),e._v(" "),t("div",{staticClass:"language-shell line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("docker")]),e._v(" run -p "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("6667")]),e._v(":6667 -v mydata:/iotdb/data -v mylogs:/iotdb/logs -d iotdb:base /iotdb/bin/start-server.sh\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br")])]),t("p",[e._v("If success, you can run "),t("code",[e._v("docker ps")]),e._v(", and get something like the following:")]),e._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._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')])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br"),t("span",{staticClass:"line-number"},[e._v("2")]),t("br")])]),t("p",[e._v("You can use the above command to get the container ID:")]),e._v(" "),t("div",{staticClass:"language-shell line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("docker")]),e._v(" container "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("ls")]),e._v("\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br")])]),t("p",[e._v("suppose the ID is <C_ID>.")]),e._v(" "),t("p",[e._v("And get the docker IP by the following, suppose the IP is <C_IP>.:")]),e._v(" "),t("div",{staticClass:"language-shell line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("docker")]),e._v(" inspect --format"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'{{.NetworkSettings.IPAddress}}'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),e._v("C_ID"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br")])]),t("p",[e._v("Now IoTDB server has started succesfully.")]),e._v(" "),t("ol",{attrs:{start:"4"}},[t("li",[e._v("If you just want to have a try by using iotdb-cli, you can:")])]),e._v(" "),t("div",{staticClass:"language-shell line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("docker")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v("exec")]),e._v(" -it "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),e._v("C_ID"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v(" /bin/bash\n$ "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("now you have enter the container"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(": /iotdb/sbin/start-cli.sh -h localhost -p "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("6667")]),e._v(" -u root -pw root\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br"),t("span",{staticClass:"line-number"},[e._v("2")]),t("br")])]),t("p",[e._v("Or, if you have a iotdb-cli locally, execute the following command:")]),e._v(" "),t("div",{staticClass:"language-shell line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ /%IOTDB_HOME%/sbin/start-cli.sh -h localhost -p "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("6667")]),e._v(" -u root -pw root\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br")])]),t("ol",{attrs:{start:"5"}},[t("li",[e._v("If you want to write codes to insert data and query data, please add the following dependence:")])]),e._v(" "),t("div",{staticClass:"language-xml line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-xml"}},[t("code",[e._v(" "),t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("<")]),e._v("dependency")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(">")])]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("<")]),e._v("groupId")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(">")])]),e._v("org.apache.iotdb"),t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("</")]),e._v("groupId")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(">")])]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("<")]),e._v("artifactId")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(">")])]),e._v("iotdb-jdbc"),t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("</")]),e._v("artifactId")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(">")])]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("<")]),e._v("version")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(">")])]),e._v("0.14.0-SNAPSHOT"),t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("</")]),e._v("version")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(">")])]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token tag"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("</")]),e._v("dependency")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(">")])]),e._v("\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br"),t("span",{staticClass:"line-number"},[e._v("2")]),t("br"),t("span",{staticClass:"line-number"},[e._v("3")]),t("br"),t("span",{staticClass:"line-number"},[e._v("4")]),t("br"),t("span",{staticClass:"line-number"},[e._v("5")]),t("br")])]),t("p",[e._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")])])}),[],!1,null,null,null);t.default=n.exports}}]);