blob: eddc89eef219f313e317581ab70b3de3a1d9ef3b [file] [log] [blame]
import{_ as o,C as i,O as c,P as l,ah as p,Q as n,U as a,ai as e,aW as t}from"./framework-e4340ccd.js";const r={},d=n("h2",{id:"way-to-get-iotdb-binary-files",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#way-to-get-iotdb-binary-files","aria-hidden":"true"},"#"),a(" Way to get IoTDB binary files")],-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),b={href:"https://github.com/apache/iotdb/blob/master/docker",target:"_blank",rel:"noopener noreferrer"},k=t('<h3 id="prerequisites" tabindex="-1"><a class="header-anchor" href="#prerequisites" aria-hidden="true">#</a> Prerequisites</h3><p>To use IoTDB, you need to have:</p><ol><li>Java &gt;= 1.8 (Please make sure the environment path has been set)</li><li>Maven &gt;= 3.6 (Optional)</li><li>Set the max open files num as 65535 to avoid &quot;too many open files&quot; problem.</li></ol><blockquote><p>Note: If you don&#39;t have maven installed, you should replace &#39;mvn&#39; in the following commands with &#39;mvnw&#39; or &#39;mvnw.cmd&#39;.</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={href:"https://iotdb.apache.org/Download/",target:"_blank",rel:"noopener noreferrer"},_=n("h3",{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),g={href:"https://iotdb.apache.org/Download/",target:"_blank",rel:"noopener noreferrer"},f={href:"https://github.com/apache/iotdb/tree/master",target:"_blank",rel:"noopener noreferrer"},y=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">&gt;</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>&gt; 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 &quot;thrift/target/generated-sources/thrift&quot; and &quot;antlr/target/generated-sources/antlr4&quot; 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>&gt; mvn clean package -pl server -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 &quot;server/target/iotdb-server-{project.version}&quot;.</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. 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">&gt;</span> mvn clean package <span class="token parameter variable">-pl</span> 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><h3 id="installation-by-docker" tabindex="-1"><a class="header-anchor" href="#installation-by-docker" aria-hidden="true">#</a> Installation by Docker</h3>`,14),w={href:"https://hub.docker.com/r/apache/iotdb",target:"_blank",rel:"noopener noreferrer"},I=t(`<h4 id="have-a-try" tabindex="-1"><a class="header-anchor" href="#have-a-try" aria-hidden="true">#</a> Have a try</h4><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"># &lt;IP Address/hostname&gt; 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">&lt;</span>IP Address/hostname<span class="token operator">&gt;</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>NoticeThe 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">&quot;3&quot;</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">&quot;6667:6667&quot;</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><h4 id="deploy-cluster" tabindex="-1"><a class="header-anchor" href="#deploy-cluster" aria-hidden="true">#</a> deploy cluster</h4>`,7),x={href:"https://github.com/apache/iotdb/tree/master/docker/src/main/DockerCompose/docker-compose-cluster-1c2d.yml",target:"_blank",rel:"noopener noreferrer"},T=t(`<p>Suppose that there are three computers of iotdb-1, iotdb-2 and iotdb-3. We called them nodes. 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">&quot;3&quot;</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">&quot;host&quot;</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">&quot;host&quot;</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 nodesthen start the cluster again.</li></ol>`,4);function D(q,B){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",b,[a("https://github.com/apache/iotdb/blob/master/docker"),e(s)])])]),k,n("p",null,[a("You can download the binary file from: "),n("a",h,[a("Download page"),e(s)])]),_,n("p",null,[a("You can get the released source code from "),n("a",g,[a("https://iotdb.apache.org/Download/"),e(s)]),a(", or from the git repository "),n("a",f,[a("https://github.com/apache/iotdb/tree/master"),e(s)]),a(" You can download the source code from:")]),y,n("p",null,[a("Apache IoTDB' Docker image is released on "),n("a",w,[a("https://hub.docker.com/r/apache/iotdb"),e(s)]),a(" Add environments of docker to update the configurations of Apache IoTDB.")]),I,n("p",null,[a("Until now, we support host and overlay networks but haven't supported bridge networks on multiple computers. Overlay networks see "),n("a",x,[a("1C2D"),e(s)]),a(" and here are the configurations and operation steps to start an IoTDB cluster with docker using host networks。")]),T])}const S=o(r,[["render",D],["__file","WayToGetIoTDB.html.vue"]]);export{S as default};