| import{_ as l,r,o as c,c as u,a as o,d as e,e as i,b as t,w as a,f as s}from"./app-dNeAgOFp.js";const h={},m=e("h1",{id:"quick-start",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#quick-start","aria-hidden":"true"},"#"),i(" Quick Start")],-1),v=e("h2",{id:"prerequisites",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#prerequisites","aria-hidden":"true"},"#"),i(" Prerequisites")],-1),b=e("p",null,"To use IoTDB, you need to have:",-1),p=e("ol",null,[e("li",null,"Java >= 1.8 (Please make sure the environments PATH variable has been set to include the Java bin directory)"),e("li",null,[i('Set the max number of open files to at least 65535 in order to avoid "too many open files" problem. '),o(" TODO: We should note how to actually do this ")])],-1),g=e("h2",{id:"installation",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#installation","aria-hidden":"true"},"#"),i(" Installation")],-1),f=e("p",null,"IoTDB can be installed using one of the following three installation methods:",-1),_=e("li",null,"Installation from source code. If you need to modify the code yourself, you can use this method.",-1),w=e("li",null,[i("Installation from binary files. Download the binary distribution from the official website. This is the recommended method, in which you will get a binary released package which you can use out-of-the-box. "),o(' TODO: From the Apache point of view the binary distributions are "convenience" ... actually the reccommended way would be to compile, as the ASF only formally distributes sources ')],-1),T={href:"https://github.com/apache/iotdb/blob/master/docker/src/main",target:"_blank",rel:"noopener noreferrer"},x=e("h2",{id:"download",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#download","aria-hidden":"true"},"#"),i(" Download")],-1),I=e("br",null,null,-1),S={href:"https://iotdb.apache.org/Download/",target:"_blank",rel:"noopener noreferrer"},y=s('<h2 id="configurations" tabindex="-1"><a class="header-anchor" href="#configurations" aria-hidden="true">#</a> Configurations</h2><p>Configuration files are located in the <code>conf</code> folder</p><ul><li>environment config module (<code>datanode-env.bat</code>, <code>datanode-env.sh</code>),</li><li>system config module (<code>iotdb-datanode.properties</code>)</li><li>log config module (<code>logback.xml</code>).</li></ul>',3),E=s(`<h2 id="start" tabindex="-1"><a class="header-anchor" href="#start" aria-hidden="true">#</a> Start</h2><p>You can go through the following step to test the installation.<br> If there is no error after execution, the installation is completed.</p><h3 id="starting-iotdb" tabindex="-1"><a class="header-anchor" href="#starting-iotdb" aria-hidden="true">#</a> Starting IoTDB</h3><p>IoTDB is designed as distributed database. You can however start it in a single node <code>standalone mode</code>.<br> In order to test your configuration, you can first start everything in <code>standalone mode</code> (i.e. 1 ConfigNode and 1 DataNode) to check everything works as expected.</p><p>Users can start IoTDB in standalone mode by using the <code>start-standalone</code> script under the <code>sbin</code> folder.</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code># Unix/OS X |
| > bash sbin/start-standalone.sh |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code># Windows |
| > sbin\\start-standalone.bat |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>Note: In order to run IoTDB in standalone mode, you need to ensure that all addresses are set to 127.0.0.1.<br> If you need to access the IoTDB from a different machine, please change the configuration item <code>dn_rpc_address</code> to the public IP of the machine where IoTDB is running and be sure to set <code>replication factors</code> to 1, which is currently the default setting.<br> It is recommended to use <code>SimpleConsensus</code> in this mode, as this has performance advantages in this mode of operation.</p><h3 id="using-the-command-line-interfave-cli" tabindex="-1"><a class="header-anchor" href="#using-the-command-line-interfave-cli" aria-hidden="true">#</a> Using the Command Line Interfave (CLI)</h3><p>IoTDB offers several ways to interact with server, here we introduce basic steps of using the <code>CLI tool</code> to insert and query data.</p><p>After installing IoTDB, there is a pre-configured default user named <code>root</code>, its default password is also set to <code>root</code>.<br> Users can use this default credentials to login to IoTDB from the <code>CLI</code>.<br> Please use the <code>start-cli</code> scriopt in the <code>sbin</code> folder in order to start the <code>CLI</code>.</p><p>When executing the script, user should assign: <code>HOST/IP</code>, <code>PORT</code>, <code>USER_NAME</code> and <code>PASSWORD</code>.</p><p>The default parameters are <code>-h 127.0.0.1 -p 6667 -u root -pw root</code>.</p><p>Here are the commands for starting the CLI:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code># Unix/OS X |
| > bash sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root |
| |
| # Windows |
| > sbin\\start-cli.bat -h 127.0.0.1 -p 6667 -u root -pw root |
| </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></div><p>The command line interface is interactive.<br> If everything is set up correctly, you should see the IoTDB logo and welcome statement:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code> _____ _________ ______ ______ |
| |_ _| | _ _ ||_ _ \`.|_ _ \\ |
| | | .--.|_/ | | \\_| | | \`. \\ | |_) | |
| | | / .'\`\\ \\ | | | | | | | __'. |
| _| |_| \\__. | _| |_ _| |_.' /_| |__) | |
| |_____|'.__.' |_____| |______.'|_______/ version x.x.x |
| |
| |
| Successfully login at 127.0.0.1:6667 |
| IoTDB> |
| </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></div><h3 id="basic-commands-for-iotdb" tabindex="-1"><a class="header-anchor" href="#basic-commands-for-iotdb" aria-hidden="true">#</a> Basic commands for IoTDB</h3><p>Next, let us go a bit more into detail to how to create a timeseries, insert data into it and how to query data from it.</p><p>Data in IoTDB is organized as a set of timeseries, in each timeseries there are some timestamp-data pairs.<br> Every timeseries belongs to a database.</p><p>All commands are executed in an SQL-like syntax we call <code>IoTDB SQL</code>.</p><p>Before defining a timeseries, we should define the database it should belong to using <code>CREATE DATABASE</code>.<br> Here's is an example on how to do that:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>IoTDB> CREATE DATABASE root.ln |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>We can also use <code>SHOW DATABASES</code> to list all databases present:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>IoTDB> SHOW DATABASES |
| +-----------------------------------+ |
| | Database| |
| +-----------------------------------+ |
| | root.ln| |
| +-----------------------------------+ |
| Database number = 1 |
| </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></div><p>After the database is created, we can use <code>CREATE TIMESERIES</code> to create new timeseries.<br> When we create a timeseries, we should define its structure as well as the data types used for each field along with their encoding scheme.</p><p>We can create two timeseries the following way:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>IoTDB> CREATE TIMESERIES root.ln.wf01.wt01.status WITH DATATYPE=BOOLEAN, ENCODING=PLAIN |
| IoTDB> CREATE TIMESERIES root.ln.wf01.wt01.temperature WITH DATATYPE=FLOAT, ENCODING=RLE |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>To query a specific timeseries, use the <code>SHOW TIMESERIES \\<Path\\></code> command. <code>\\<Path\\></code> represents the path of the timeseries.<br> Its default value is null, which means that we're querying all timeseries in the system (the same as using <code>SHOW TIMESERIES root</code>).</p><p>Here are some examples:</p><ol><li>Query all timeseries in the system:</li></ol><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>IoTDB> SHOW TIMESERIES |
| +-------------------------------+---------------+--------+--------+ |
| | Timeseries| Database|DataType|Encoding| |
| +-------------------------------+---------------+--------+--------+ |
| | root.ln.wf01.wt01.status| root.ln| BOOLEAN| PLAIN| |
| | root.ln.wf01.wt01.temperature| root.ln| FLOAT| RLE| |
| +-------------------------------+---------------+--------+--------+ |
| Total timeseries number = 2 |
| </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></div><ol start="2"><li>Query a specific timeseries (root.ln.wf01.wt01.status):</li></ol><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>IoTDB> SHOW TIMESERIES root.ln.wf01.wt01.status |
| +------------------------------+--------------+--------+--------+ |
| | Timeseries| Database|DataType|Encoding| |
| +------------------------------+--------------+--------+--------+ |
| | root.ln.wf01.wt01.status| root.ln| BOOLEAN| PLAIN| |
| +------------------------------+--------------+--------+--------+ |
| Total timeseries number = 1 |
| </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></div><p>Insertion of timeseries data is the probably most basic operation of IoTDB.<br> You can use the <code>INSERT</code> command to do this.</p><p>Here come some examples on how to do that.<br> In the <code>INTO</code> part we tell IoTDB which timeseries we want to store the data in as well as which fields we'll be filling.<br> Please note, that the timestamp field is mandatory for this step and that we don't necessarily have to fill all fields defined of the timeseries we're inserting into:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>IoTDB> INSERT INTO root.ln.wf01.wt01(timestamp,status) values(100,true); |
| IoTDB> INSERT INTO root.ln.wf01.wt01(timestamp,status,temperature) values(200,false,20.71) |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>The data we’ve just inserted will then look like this if we query it:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>IoTDB> SELECT status FROM root.ln.wf01.wt01 |
| +-----------------------+------------------------+ |
| | Time|root.ln.wf01.wt01.status| |
| +-----------------------+------------------------+ |
| |1970-01-01T08:00:00.100| true| |
| |1970-01-01T08:00:00.200| false| |
| +-----------------------+------------------------+ |
| Total line number = 2 |
| </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></div><p>We can also query several timeseries fields at once like this:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>IoTDB> SELECT * FROM root.ln.wf01.wt01 |
| +-----------------------+--------------------------+-----------------------------+ |
| | Time| root.ln.wf01.wt01.status|root.ln.wf01.wt01.temperature| |
| +-----------------------+--------------------------+-----------------------------+ |
| |1970-01-01T08:00:00.100| true| null| |
| |1970-01-01T08:00:00.200| false| 20.71| |
| +-----------------------+--------------------------+-----------------------------+ |
| Total line number = 2 |
| </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></div><p>The commands to exit the CLI are:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>IoTDB> quit |
| or |
| IoTDB> exit |
| </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></div>`,43),D=e("code",null,"IoTDB SQL",-1),A=s(`<h3 id="stopping-iotdb" tabindex="-1"><a class="header-anchor" href="#stopping-iotdb" aria-hidden="true">#</a> Stopping IoTDB</h3><p>The server can be stopped using <code>ctrl-C</code> or by running the following script:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code># Unix/OS X |
| > bash sbin/stop-standalone.sh |
| |
| # Windows |
| > sbin\\stop-standalone.bat |
| </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></div><p>Note: In Linux, please add the <code>sudo</code> as far as possible, or else the stopping process may fail. <!-- TODO: Actually running things as \`root\` is considered a bad practice from security perspective. Is there a reson for requiring root? I don't think we're using any privileged ports or resources. --></p>`,4),B=s(`<h3 id="administration" tabindex="-1"><a class="header-anchor" href="#administration" aria-hidden="true">#</a> Administration</h3><p>When installing IoTDB, there is a default user which is automatically pre-configured.<br> Its username is <code>root</code>, and the default password for it is also <code>root</code>.<br> This user is a user with administrative privileges, who cannot be deleted and has all privileges assigned to it.<br> Neither can new privileges be granted to the root user nor can privileges owned by it be revoked.</p><p>We strongly recommend you change the default password.<br> You do this using the following command:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>ALTER USER <username> SET PASSWORD <password>; |
| Example: IoTDB > ALTER USER root SET PASSWORD 'newpwd'; |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div>`,4),L=s('<h2 id="basic-configuration" tabindex="-1"><a class="header-anchor" href="#basic-configuration" aria-hidden="true">#</a> Basic configuration</h2><p>The configuration files are located in the <code>conf</code> directory.</p><p>The most important ones being:</p><ul><li>environment variable configuration (<code>datanode-env.bat</code>, <code>datanode-env.sh</code>),</li><li>system configuration (<code>iotdb-datanode.properties</code>)</li><li>log configuration (<code>logback.xml</code>).</li></ul>',4);function O(N,R){const n=r("RouterLink"),d=r("ExternalLinkIcon");return c(),u("div",null,[o(` |
| |
| 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. |
| |
| `),m,e("p",null,[i("This short guide will walk you through the basic process of using IoTDB. For a more comprehensive guide, please visit our website's "),t(n,{to:"/UserGuide/V1.2.x/IoTDB-Introduction/What-is-IoTDB.html"},{default:a(()=>[i("User Guide")]),_:1}),i(".")]),v,b,p,g,f,e("ul",null,[_,w,e("li",null,[i("Using Docker:The path to the dockerfile is "),e("a",T,[i("github"),t(d)])])]),x,e("p",null,[i("You can download the binary distribution from:"),I,e("a",S,[i("Download Page"),t(d)])]),y,e("p",null,[i("For more information, please go to "),t(n,{to:"/UserGuide/V1.2.x/stage/DataNode-Config-Manual.html"},{default:a(()=>[i("Config")]),_:1}),i(".")]),E,e("p",null,[i("For more information on which commands are supported by "),D,i(", please see "),t(n,{to:"/UserGuide/V1.2.x/SQL-Manual/SQL-Manual.html"},{default:a(()=>[i("SQL Reference")]),_:1}),i(".")]),A,e("p",null,[i("More explanations on running IoTDB in a clustered environment are available at "),t(n,{to:"/UserGuide/V1.2.x/stage/Cluster/Cluster-Setup.html"},{default:a(()=>[i("Cluster-Setup")]),_:1}),i(".")]),B,e("p",null,[i("More about administration options:"),t(n,{to:"/UserGuide/V1.2.x/User-Manual/Security-Management.html"},{default:a(()=>[i("Administration Management")]),_:1})]),L])}const k=l(h,[["render",O],["__file","QuickStart.html.vue"]]);export{k as default}; |