Go to file
Jialin Qiao 719e87eff2
Merge pull request #353 from yx-zhang/configMaxCon
add max concurrent client number
2019-08-25 21:33:39 +08:00
.github/ISSUE_TEMPLATE Update issue templates (#462) 2018-11-23 13:36:52 +08:00
.mvn/wrapper fix readme bug 2019-07-27 10:36:57 +08:00
client fix IOTDB-168 and 169 2019-08-21 11:22:15 +08:00
distribution - Nothing is built outside the target directory anymore 2019-08-05 14:41:25 +02:00
docker/src/main change dockerfile to build from the master branch 2019-07-31 10:12:58 +08:00
docs update 2-Usage.md and pox.xml of module example/tsfile 2019-08-21 14:47:27 +08:00
example Remove unnecessary dependencies. 2019-08-22 21:08:39 +08:00
grafana - Nothing is built outside the target directory anymore 2019-08-05 14:41:25 +02:00
hadoop - Nothing is built outside the target directory anymore 2019-08-05 14:41:25 +02:00
jdbc implement rpc compression (#323) 2019-08-19 15:59:25 +08:00
licenses update copyright of MIT, BSD licenses 2019-07-28 19:40:44 +08:00
server formatting code 2019-08-25 21:30:06 +08:00
service-rpc change version to 0.9.0-SNAPSHOT 2019-07-27 10:40:13 +08:00
spark-tsfile [IOTDB-13]Support batched ingestion 2019-08-14 23:06:37 +08:00
tsfile move "tsfile/examle" to "example/tsfile" and fix 'example/tsfile/TsFileRead.java' 2019-08-21 14:20:48 +08:00
.checkstyle IT IS TIME TO KILL THANOS. (#577) 2019-01-12 00:37:14 +08:00
.gitignore - Nothing is built outside the target directory anymore 2019-08-05 14:41:25 +02:00
.travis.yml update modules (#289) 2019-07-23 11:02:09 +08:00
DISCLAIMER Split the LICENSE and NOTICE as source-release version and binary-release version (#300) 2019-07-26 18:00:03 +08:00
Jenkinsfile ASF Header: remove the rest '2019 Apache IoTDB(incubating)...' (#30) 2019-01-25 09:54:22 +08:00
LICENSE fix readme bug 2019-07-27 10:36:57 +08:00
LICENSE-binary fix copyright about the year, remove code declaration about hive and mavenWrapper 2019-07-31 12:47:45 +02:00
NOTICE Fixed patent number 2019-07-31 09:54:43 +08:00
NOTICE-binary fix copyright about the year, remove code declaration about hive and mavenWrapper 2019-07-31 12:47:45 +02:00
README.md fix readme (#335) 2019-08-12 13:31:27 +08:00
RELEASE_NOTES.md Release folder (#282) 2019-07-23 10:59:23 +08:00
asf.header 1. modify asf header for each file; 2. enable apache-rat-plugin; 3. add more exclusive files on apache-rat-plugin and license-maven-plugin, i.e., *.json, *.md, and *.csv 2019-01-19 18:52:35 +08:00
checkstyle.xml fix sonar of postback module 2019-01-25 17:03:37 +08:00
codecov.yml Split the LICENSE and NOTICE as source-release version and binary-release version (#300) 2019-07-26 18:00:03 +08:00
java-google-style.xml 1. modify asf header for each file; 2. enable apache-rat-plugin; 3. add more exclusive files on apache-rat-plugin and license-maven-plugin, i.e., *.json, *.md, and *.csv 2019-01-19 18:52:35 +08:00
jenkins.pom 1. modify asf header for each file; 2. enable apache-rat-plugin; 3. add more exclusive files on apache-rat-plugin and license-maven-plugin, i.e., *.json, *.md, and *.csv 2019-01-19 18:52:35 +08:00
mvnw.cmd 1. modify asf header for each file; 2. enable apache-rat-plugin; 3. add more exclusive files on apache-rat-plugin and license-maven-plugin, i.e., *.json, *.md, and *.csv 2019-01-19 18:52:35 +08:00
mvnw.sh Minor modification of README.md (#127) 2019-04-03 21:29:57 +08:00
pom.xml - Nothing is built outside the target directory anymore 2019-08-05 14:41:25 +02:00

README.md

IoTDB

Build Status codecov GitHub release License IoTDB Website

Overview

IoTDB (Internet of Things Database) is an integrated data management engine designed for time series data, which can provide users specific services for data collection, storage and analysis. Due to its light weight structure, high performance and usable features together with its intense integration with Hadoop and Spark ecology, IoTDB meets the requirements of massive dataset storage, high-speed data input and complex data analysis in the IoT industrial field.

Main Features

IoTDB's features are as following:

  1. Flexible deployment. IoTDB provides users one-click installation tool on the cloud, once-decompressed-used terminal tool and the bridge tool between cloud platform and terminal tool (Data Synchronization Tool).
  2. Low cost on hardware. IoTDB can reach a high compression ratio of disk storage
  3. Efficient directory structure. IoTDB supports efficient organization for complex time series data structure from intelligent networking devices, organization for time series data from devices of the same type, fuzzy searching strategy for massive and complex directory of time series data.
  4. High-throughput read and write. IoTDB supports millions of low-power devices' strong connection data access, high-speed data read and write for intelligent networking devices and mixed devices mentioned above.
  5. Rich query semantics. IoTDB supports time alignment for time series data across devices and sensors, computation in time series field (frequency domain transformation) and rich aggregation function support in time dimension.
  6. Easy to get start. IoTDB supports SQL-Like language, JDBC standard API and import/export tools which is easy to use.
  7. Intense integration with Open Source Ecosystem. IoTDB supports Hadoop, Spark, etc. analysis ecosystems and Grafana visualization tool.

For the latest information about IoTDB, please visit our IoTDB official website.

Prerequisites

IoTDB requires Java (>= 1.8). To use IoTDB, JRE should be installed. To compile IoTDB, JDK should be installed.

If you want to compile and install IoTDB from source code, JDK and Maven (>= 3.1) are required. While Maven is not mandatory to be installed standalone, you can use the provided Maven wrapper, ./mvnw.sh on Linux/OS X or .\mvnw.cmd on Windows, to facilitate development.

If you want to use Hadoop or Spark to analyze IoTDB data file (called as TsFile), you need to compile the hadoop and spark modules.

Quick Start

This short guide will walk you through the basic process of using IoTDB. For a more-complete guide, please visit our website's User Guide.

Installation from source code

You can get the released source code from https://iotdb.apache.org/#/Download, or from the git repository https://github.com/apache/incubator-iotdb/tree/master

Now suppose your directory is like this:

> pwd
/workspace/incubator-iotdb

> ls -l
incubator-iotdb/     <-- root path
|
+- server/
|
+- jdbc/
|
+- tsfile/
|
...
|
+- pom.xml

Let $IOTDB_HOME = /workspace/incubator-iotdb/server/target/iotdb-server-{project.version}

Let $IOTDB_CLI_HOME = /workspace/incubator-iotdb/client/target/iotdb-client-{project.version}

Note:

  • if IOTDB_HOME is not explicitly assigned, then by default IOTDB_HOME is the direct parent directory of sbin/start-server.sh on Unix/OS X (or that of sbin\start-server.bat on Windows).

  • if IOTDB_CLI_HOME is not explicitly assigned, then by default IOTDB_CLI_HOME is the direct parent directory of sbin/start-client.sh on Unix/OS X (or that of sbin\start-client.bat on Windows).

If you are not the first time that building IoTDB, remember deleting the following files:

> rm -rf $IOTDB_HOME/data/
> rm -rf $IOTDB_HOME/lib/

Then under the root path of incubator-iotdb, you can build IoTDB using Maven:

> pwd
/workspace/incubator-iotdb

> mvn clean package -pl server -am -Dmaven.test.skip=true

If successful, you will see the the following text in the terminal:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache IoTDB (incubating) Project Parent POM ....... SUCCESS [  6.405 s]
[INFO] TsFile ............................................. SUCCESS [ 10.435 s]
[INFO] Service-rpc ........................................ SUCCESS [  4.170 s]
[INFO] IoTDB Jdbc ......................................... SUCCESS [  3.252 s]
[INFO] IoTDB Server ....................................... SUCCESS [  8.072 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Otherwise, you may need to check the error statements and fix the problems.

After build, the IoTDB project will be at the folder "server/target/iotdb-server-{project.version}". The folder will include the following contents:

server/target/iotdb-server-{project.version}  <-- root path
|
+- sbin/       <-- script files for starting and stopping the server
|
+- tools/       <-- script files of tools
|
+- conf/      <-- configuration files
|
+- lib/       <-- project dependencies

NOTE: Directories "service-rpc/target/generated-sources/thrift" and "server/target/generated-sources/antlr3" need to be added to sources roots to avoid compilation errors.

Configure

Before starting to use IoTDB, you need to config the configuration files first. For your convenience, we have already set the default config in the files.

In total, we provide users three kinds of configurations module: environment config module (iotdb-env.bat, iotdb-env.sh), system config module (tsfile-format.properties, iotdb-engine.properties) and log config module (logback.xml). All of these kinds of configuration files are put in iotdb/config folder.

For more, you are advised to check our documentation Chapter4: Deployment and Management in detail.

Start

Start Server

After that we start the server. Running the startup script:

# Unix/OS X
> $IOTDB_HOME/sbin/start-server.sh

# Windows
> $IOTDB_HOME\sbin\start-server.bat

Stop Server

The server can be stopped with ctrl-C or the following script:

# Unix/OS X
> $IOTDB_HOME/sbin/stop-server.sh

# Windows
> $IOTDB_HOME\sbin\stop-server.bat

Start Client

Now let's trying to read and write some data from IoTDB using our Client. To start the client, you need to explicit the server's IP and PORT as well as the USER_NAME and PASSWORD.

# You can first build cli project
> pwd
/workspace/incubator-iotdb

> mvn clean package -pl client -am -Dmaven.test.skip=true

After build, the IoTDB client will be at the folder "client/target/iotdb-client-{project.version}".

# Unix/OS X
> $IOTDB_CLI_HOME/sbin/start-client.sh -h <IP> -p <PORT> -u <USER_NAME>

# Windows
> $IOTDB_CLI_HOME\sbin\start-client.bat -h <IP> -p <PORT> -u <USER_NAME>

NOTE: In the system, we set a default user in IoTDB named 'root'. The default password for 'root' is 'root'. You can use this default user if you are making the first try or you didn't create users by yourself.

The command line client is interactive so if everything is ready you should see the welcome logo and statements:

 _____       _________  ______   ______
|_   _|     |  _   _  ||_   _ `.|_   _ \
  | |   .--.|_/ | | \_|  | | `. \ | |_) |
  | | / .'`\ \  | |      | |  | | |  __'.
 _| |_| \__. | _| |_    _| |_.' /_| |__) |
|_____|'.__.' |_____|  |______.'|_______/  version x.x.x


IoTDB> login successfully
IoTDB>

Have a try

Now, you can use IoTDB SQL to operate IoTDB, and when you've had enough fun, you can input 'quit' or 'exit' command to leave the client.

But lets try something slightly more interesting:

IoTDB> SET STORAGE GROUP TO root.vehicle
It costs xxxs
IoTDB> CREATE TIMESERIES root.vehicle.d0.s0 WITH DATATYPE=INT32, ENCODING=RLE
It costs xxxs

Till now, we have already create a table called root.vehicle and add a column called d0.s0 in the table. Let's take a look at what we have done by 'SHOW TIMESERIES' command.

IoTDB> SHOW TIMESERIES
===  Timeseries Tree  ===

{
        "root":{
                "vehicle":{
                        "d0":{
                                "s0":{
                                        "args":"{}",
                                        "StorageGroup":"root.vehicle",
                                        "DataType":"INT32",
                                        "Compressor":"UNCOMPRESSED",
                                        "Encoding":"RLE"
                                }
                        }
                }
        }
}

Insert time series data is the basic operation of IoTDB, you can use 'INSERT' command to finish this:

IoTDB> insert into root.vehicle.d0(timestamp,s0) values(1,101);
It costs xxxs

The data we've just inserted displays like this:

IoTDB> SELECT d0.s0 FROM root.vehicle
+-----------------------------+------------------+
|                         Time|root.vehicle.d0.s0|
+-----------------------------+------------------+
|1970-01-01T08:00:00.001+08:00|               101|
+-----------------------------+------------------+
Total line number = 1
It costs xxxs

If your session looks similar to what's above, congrats, your IoTDB is operational!

For more on what commands are supported by IoTDB SQL, see our documentation Chapter 5: IoTDB SQL Documentation.

Usage of import-csv.sh

Create metadata

SET STORAGE GROUP TO root.fit.d1;
SET STORAGE GROUP TO root.fit.d2;
SET STORAGE GROUP TO root.fit.p;
CREATE TIMESERIES root.fit.d1.s1 WITH DATATYPE=INT32,ENCODING=RLE;
CREATE TIMESERIES root.fit.d1.s2 WITH DATATYPE=TEXT,ENCODING=PLAIN;
CREATE TIMESERIES root.fit.d2.s1 WITH DATATYPE=INT32,ENCODING=RLE;
CREATE TIMESERIES root.fit.d2.s3 WITH DATATYPE=INT32,ENCODING=RLE;
CREATE TIMESERIES root.fit.p.s1 WITH DATATYPE=INT32,ENCODING=RLE;

Run import shell

# Unix/OS X
> $IOTDB_CLI_HOME/tools/import-csv.sh -h <ip> -p <port> -u <username> -pw <password> -f <xxx.csv>

# Windows
> $IOTDB_CLI_HOME\tools\import-csv.bat -h <ip> -p <port> -u <username> -pw <password> -f <xxx.csv>

Error data file

csvInsertError.error

Usage of export-csv.sh

Run export shell

# Unix/OS X
> $IOTDB_CLI_HOME/tools/export-csv.sh -h <ip> -p <port> -u <username> -pw <password> -td <xxx.csv> [-tf <time-format>]

# Windows
> $IOTDB_CLI_HOME\tools\export-csv.bat -h <ip> -p <port> -u <username> -pw <password> -td <xxx.csv> [-tf <time-format>]