| import{_ as o,r as i,o as c,c as l,a as p,d as n,e as a,b as e,f as t}from"./app-5cdcb249.js";const r={},d=n("h1",{id:"get-installation-package",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#get-installation-package","aria-hidden":"true"},"#"),a(" Get Installation Package")],-1),u=n("p",null,"IoTDB provides you three installation methods, you can refer to the following suggestions, choose one of them:",-1),v=n("li",null,"Installation from source code. If you need to modify the code yourself, you can use this method.",-1),m=n("li",null,"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.",-1),k={href:"https://github.com/apache/iotdb/blob/master/docker",target:"_blank",rel:"noopener noreferrer"},b=t('<h2 id="prerequisites" tabindex="-1"><a class="header-anchor" href="#prerequisites" aria-hidden="true">#</a> Prerequisites</h2><p>To use IoTDB, you need to have:</p><ol><li>Java >= 1.8 (Please make sure the environment path has been set)</li><li>Maven >= 3.6 (Optional)</li><li>Set the max open files num as 65535 to avoid "too many open files" problem.</li></ol><blockquote><p>Note: If you don't have maven installed, you should replace 'mvn' in the following commands with 'mvnw' or 'mvnw.cmd'.</p><h3 id="installation-from-binary-files" tabindex="-1"><a class="header-anchor" href="#installation-from-binary-files" aria-hidden="true">#</a> Installation from binary files</h3></blockquote>',4),h=n("br",null,null,-1),_={href:"https://iotdb.apache.org/Download/",target:"_blank",rel:"noopener noreferrer"},g=n("h2",{id:"installation-from-source-code",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#installation-from-source-code","aria-hidden":"true"},"#"),a(" Installation from source code")],-1),f={href:"https://iotdb.apache.org/Download/",target:"_blank",rel:"noopener noreferrer"},y={href:"https://github.com/apache/iotdb/tree/master",target:"_blank",rel:"noopener noreferrer"},w=n("br",null,null,-1),I=t(`<div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>git clone https://github.com/apache/iotdb.git |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>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 <code>git checkout -b my_{project.version} v{project.version}</code>. E.g., you want to build the version <code>0.12.4</code>, you can execute this command to make it:</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token operator">></span> <span class="token function">git</span> checkout <span class="token parameter variable">-b</span> my_0.12.4 v0.12.4 |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>Then you can execute this command to build the version that you want:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>> mvn clean package -DskipTests |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>Then the binary version (including both server and client) can be found at <strong>distribution/target/apache-iotdb-{project.version}-bin.zip</strong></p><blockquote><p>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.</p></blockquote><p>If you would like to build the IoTDB server, you can run the following command under the root path of iotdb:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>> mvn clean package -pl iotdb-core/datanode -am -DskipTests |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>After build, the IoTDB server will be at the folder "server/target/iotdb-server-{project.version}".</p><p>If you would like to build a module, you can execute command <code>mvn clean package -pl {module.name} -am -DskipTests</code> under the root path of IoTDB.<br> If you need the jar with dependencies, you can add parameter <code>-P get-jar-with-dependencies</code> after the command. E.g., If you need the jar of jdbc with dependencies, you can execute this command:</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token operator">></span> mvn clean package <span class="token parameter variable">-pl</span> iotdb-client/jdbc <span class="token parameter variable">-am</span> <span class="token parameter variable">-DskipTests</span> <span class="token parameter variable">-P</span> get-jar-with-dependencies |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>Then you can find it under the path <code>{module.name}/target</code>.</p><h2 id="installation-by-docker" tabindex="-1"><a class="header-anchor" href="#installation-by-docker" aria-hidden="true">#</a> Installation by Docker</h2>`,14),x={href:"https://hub.docker.com/r/apache/iotdb",target:"_blank",rel:"noopener noreferrer"},T=n("br",null,null,-1),D=t(`<h3 id="have-a-try" tabindex="-1"><a class="header-anchor" href="#have-a-try" aria-hidden="true">#</a> Have a try</h3><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token comment"># get IoTDB official image</span> |
| <span class="token function">docker</span> pull apache/iotdb:1.1.0-standalone |
| <span class="token comment"># create docker bridge network</span> |
| <span class="token function">docker</span> network create <span class="token parameter variable">--driver</span><span class="token operator">=</span>bridge <span class="token parameter variable">--subnet</span><span class="token operator">=</span><span class="token number">172.18</span>.0.0/16 <span class="token parameter variable">--gateway</span><span class="token operator">=</span><span class="token number">172.18</span>.0.1 iotdb |
| <span class="token comment"># create docker container</span> |
| <span class="token function">docker</span> run <span class="token parameter variable">-d</span> <span class="token parameter variable">--name</span> iotdb-service <span class="token punctuation">\\</span> |
| <span class="token parameter variable">--hostname</span> iotdb-service <span class="token punctuation">\\</span> |
| <span class="token parameter variable">--network</span> iotdb <span class="token punctuation">\\</span> |
| <span class="token parameter variable">--ip</span> <span class="token number">172.18</span>.0.6 <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-p</span> <span class="token number">6667</span>:6667 <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-e</span> <span class="token assign-left variable">cn_internal_address</span><span class="token operator">=</span>iotdb-service <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-e</span> <span class="token assign-left variable">cn_target_config_node_list</span><span class="token operator">=</span>iotdb-service:10710 <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-e</span> <span class="token assign-left variable">cn_internal_port</span><span class="token operator">=</span><span class="token number">10710</span> <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-e</span> <span class="token assign-left variable">cn_consensus_port</span><span class="token operator">=</span><span class="token number">10720</span> <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-e</span> <span class="token assign-left variable">dn_rpc_address</span><span class="token operator">=</span>iotdb-service <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-e</span> <span class="token assign-left variable">dn_internal_address</span><span class="token operator">=</span>iotdb-service <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-e</span> <span class="token assign-left variable">dn_target_config_node_list</span><span class="token operator">=</span>iotdb-service:10710 <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-e</span> <span class="token assign-left variable">dn_mpp_data_exchange_port</span><span class="token operator">=</span><span class="token number">10740</span> <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-e</span> <span class="token assign-left variable">dn_schema_region_consensus_port</span><span class="token operator">=</span><span class="token number">10750</span> <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-e</span> <span class="token assign-left variable">dn_data_region_consensus_port</span><span class="token operator">=</span><span class="token number">10760</span> <span class="token punctuation">\\</span> |
| <span class="token parameter variable">-e</span> <span class="token assign-left variable">dn_rpc_port</span><span class="token operator">=</span><span class="token number">6667</span> <span class="token punctuation">\\</span> |
| apache/iotdb:1.1.0-standalone |
| <span class="token comment"># execute SQL</span> |
| <span class="token function">docker</span> <span class="token builtin class-name">exec</span> <span class="token parameter variable">-ti</span> iotdb-service /iotdb/sbin/start-cli.sh <span class="token parameter variable">-h</span> iotdb-service |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>External access:</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token comment"># <IP Address/hostname> is the real IP or domain address rather than the one in docker network, could be 127.0.0.1 within the computer.</span> |
| <span class="token variable">$IOTDB_HOME</span>/sbin/start-cli.sh <span class="token parameter variable">-h</span> <span class="token operator"><</span>IP Address/hostname<span class="token operator">></span> <span class="token parameter variable">-p</span> <span class="token number">6667</span> |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>Notice:The confignode service would fail when restarting this container if the IP Adress of the container has been changed.</p><div class="language-yaml line-numbers-mode" data-ext="yml"><pre class="language-yaml"><code><span class="token comment"># docker-compose-standalone.yml</span> |
| <span class="token key atrule">version</span><span class="token punctuation">:</span> <span class="token string">"3"</span> |
| <span class="token key atrule">services</span><span class="token punctuation">:</span> |
| <span class="token key atrule">iotdb-service</span><span class="token punctuation">:</span> |
| <span class="token key atrule">image</span><span class="token punctuation">:</span> apache/iotdb<span class="token punctuation">:</span>1.1.0<span class="token punctuation">-</span>standalone |
| <span class="token key atrule">hostname</span><span class="token punctuation">:</span> iotdb<span class="token punctuation">-</span>service |
| <span class="token key atrule">container_name</span><span class="token punctuation">:</span> iotdb<span class="token punctuation">-</span>service |
| <span class="token key atrule">ports</span><span class="token punctuation">:</span> |
| <span class="token punctuation">-</span> <span class="token string">"6667:6667"</span> |
| <span class="token key atrule">environment</span><span class="token punctuation">:</span> |
| <span class="token punctuation">-</span> cn_internal_address=iotdb<span class="token punctuation">-</span>service |
| <span class="token punctuation">-</span> cn_internal_port=10710 |
| <span class="token punctuation">-</span> cn_consensus_port=10720 |
| <span class="token punctuation">-</span> cn_target_config_node_list=iotdb<span class="token punctuation">-</span>service<span class="token punctuation">:</span><span class="token number">10710</span> |
| <span class="token punctuation">-</span> dn_rpc_address=iotdb<span class="token punctuation">-</span>service |
| <span class="token punctuation">-</span> dn_internal_address=iotdb<span class="token punctuation">-</span>service |
| <span class="token punctuation">-</span> dn_rpc_port=6667 |
| <span class="token punctuation">-</span> dn_mpp_data_exchange_port=10740 |
| <span class="token punctuation">-</span> dn_schema_region_consensus_port=10750 |
| <span class="token punctuation">-</span> dn_data_region_consensus_port=10760 |
| <span class="token punctuation">-</span> dn_target_config_node_list=iotdb<span class="token punctuation">-</span>service<span class="token punctuation">:</span><span class="token number">10710</span> |
| <span class="token key atrule">volumes</span><span class="token punctuation">:</span> |
| <span class="token punctuation">-</span> ./data<span class="token punctuation">:</span>/iotdb/data |
| <span class="token punctuation">-</span> ./logs<span class="token punctuation">:</span>/iotdb/logs |
| <span class="token key atrule">networks</span><span class="token punctuation">:</span> |
| <span class="token key atrule">iotdb</span><span class="token punctuation">:</span> |
| <span class="token key atrule">ipv4_address</span><span class="token punctuation">:</span> 172.18.0.6 |
| |
| <span class="token key atrule">networks</span><span class="token punctuation">:</span> |
| <span class="token key atrule">iotdb</span><span class="token punctuation">:</span> |
| <span class="token key atrule">external</span><span class="token punctuation">:</span> <span class="token boolean important">true</span> |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="deploy-cluster" tabindex="-1"><a class="header-anchor" href="#deploy-cluster" aria-hidden="true">#</a> deploy cluster</h3>`,7),q=n("br",null,null,-1),A={href:"https://github.com/apache/iotdb/tree/master/docker/src/main/DockerCompose/docker-compose-cluster-1c2d.yml",target:"_blank",rel:"noopener noreferrer"},B=t(`<p>Suppose that there are three computers of iotdb-1, iotdb-2 and iotdb-3. We called them nodes.<br> Here is the docker-compose file of iotdb-2, as the sample:</p><div class="language-yaml line-numbers-mode" data-ext="yml"><pre class="language-yaml"><code><span class="token key atrule">version</span><span class="token punctuation">:</span> <span class="token string">"3"</span> |
| <span class="token key atrule">services</span><span class="token punctuation">:</span> |
| <span class="token key atrule">iotdb-confignode</span><span class="token punctuation">:</span> |
| <span class="token key atrule">image</span><span class="token punctuation">:</span> apache/iotdb<span class="token punctuation">:</span>1.1.0<span class="token punctuation">-</span>confignode |
| <span class="token key atrule">container_name</span><span class="token punctuation">:</span> iotdb<span class="token punctuation">-</span>confignode |
| <span class="token key atrule">environment</span><span class="token punctuation">:</span> |
| <span class="token punctuation">-</span> cn_internal_address=iotdb<span class="token punctuation">-</span><span class="token number">2</span> |
| <span class="token punctuation">-</span> cn_target_config_node_list=iotdb<span class="token punctuation">-</span>1<span class="token punctuation">:</span><span class="token number">10710</span> |
| <span class="token punctuation">-</span> cn_internal_port=10710 |
| <span class="token punctuation">-</span> cn_consensus_port=10720 |
| <span class="token punctuation">-</span> schema_replication_factor=3 |
| <span class="token punctuation">-</span> schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus |
| <span class="token punctuation">-</span> config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus |
| <span class="token punctuation">-</span> data_replication_factor=3 |
| <span class="token punctuation">-</span> data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus |
| <span class="token key atrule">volumes</span><span class="token punctuation">:</span> |
| <span class="token punctuation">-</span> /etc/hosts<span class="token punctuation">:</span>/etc/hosts<span class="token punctuation">:</span>ro |
| <span class="token punctuation">-</span> ./data/confignode<span class="token punctuation">:</span>/iotdb/data |
| <span class="token punctuation">-</span> ./logs/confignode<span class="token punctuation">:</span>/iotdb/logs |
| <span class="token key atrule">network_mode</span><span class="token punctuation">:</span> <span class="token string">"host"</span> |
| |
| <span class="token key atrule">iotdb-datanode</span><span class="token punctuation">:</span> |
| <span class="token key atrule">image</span><span class="token punctuation">:</span> apache/iotdb<span class="token punctuation">:</span>1.1.0<span class="token punctuation">-</span>datanode |
| <span class="token key atrule">container_name</span><span class="token punctuation">:</span> iotdb<span class="token punctuation">-</span>datanode |
| <span class="token key atrule">environment</span><span class="token punctuation">:</span> |
| <span class="token punctuation">-</span> dn_rpc_address=iotdb<span class="token punctuation">-</span><span class="token number">2</span> |
| <span class="token punctuation">-</span> dn_internal_address=iotdb<span class="token punctuation">-</span><span class="token number">2</span> |
| <span class="token punctuation">-</span> dn_target_config_node_list=iotdb<span class="token punctuation">-</span>1<span class="token punctuation">:</span><span class="token number">10710</span> |
| <span class="token punctuation">-</span> data_replication_factor=3 |
| <span class="token punctuation">-</span> dn_rpc_port=6667 |
| <span class="token punctuation">-</span> dn_mpp_data_exchange_port=10740 |
| <span class="token punctuation">-</span> dn_schema_region_consensus_port=10750 |
| <span class="token punctuation">-</span> dn_data_region_consensus_port=10760 |
| <span class="token punctuation">-</span> data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus |
| <span class="token punctuation">-</span> schema_replication_factor=3 |
| <span class="token punctuation">-</span> schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus |
| <span class="token punctuation">-</span> config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus |
| <span class="token key atrule">volumes</span><span class="token punctuation">:</span> |
| <span class="token punctuation">-</span> /etc/hosts<span class="token punctuation">:</span>/etc/hosts<span class="token punctuation">:</span>ro |
| <span class="token punctuation">-</span> ./data/datanode<span class="token punctuation">:</span>/iotdb/data/ |
| <span class="token punctuation">-</span> ./logs/datanode<span class="token punctuation">:</span>/iotdb/logs/ |
| <span class="token key atrule">network_mode</span><span class="token punctuation">:</span> <span class="token string">"host"</span> |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Notice:</p><ol><li>The <code>dn_target_config_node_list</code> of three nodes must the same and it is the first starting node of <code>iotdb-1</code> with the cn_internal_port of 10710。</li><li>In this docker-compose file,<code>iotdb-2</code> should be replace with the real IP or hostname of each node to generate docker compose files in the other nodes.</li><li>The services would talk with each other, so they need map the /etc/hosts file or add the <code>extra_hosts</code> to the docker compose file.</li><li>We must start the IoTDB services of <code>iotdb-1</code> first at the first time of starting.</li><li>Stop and remove all the IoTDB services and clean up the <code>data</code> and <code>logs</code> directories of the 3 nodes,then start the cluster again.</li></ol>`,4);function S(N,C){const s=i("ExternalLinkIcon");return c(),l("div",null,[p(` |
| |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| |
| `),d,u,n("ul",null,[v,m,n("li",null,[a("Using Docker. The path to the dockerfile is "),n("a",k,[a("https://github.com/apache/iotdb/blob/master/docker"),e(s)])])]),b,n("p",null,[a("You can download the binary file from:"),h,n("a",_,[a("Download page"),e(s)])]),g,n("p",null,[a("You can get the released source code from "),n("a",f,[a("https://iotdb.apache.org/Download/"),e(s)]),a(", or from the git repository "),n("a",y,[a("https://github.com/apache/iotdb/tree/master"),e(s)]),w,a(" You can download the source code from:")]),I,n("p",null,[a("Apache IoTDB' Docker image is released on "),n("a",x,[a("https://hub.docker.com/r/apache/iotdb"),e(s)]),T,a(" Add environments of docker to update the configurations of Apache IoTDB.")]),D,n("p",null,[a("Until now, we support host and overlay networks but haven't supported bridge networks on multiple computers."),q,a(" Overlay networks see "),n("a",A,[a("1C2D"),e(s)]),a(" and here are the configurations and operation steps to start an IoTDB cluster with docker using host networks。")]),B])}const L=o(r,[["render",S],["__file","Get-Installation-Package.html.vue"]]);export{L as default}; |