Code Monkey home page Code Monkey logo

iotdb's Introduction

English | 中文

IoTDB

Unit-Test codecov GitHub release License IoTDB Website Maven Version Gitpod Ready-to-Code Slack Status

Overview

IoTDB (Internet of Things Database) is a data management system for time series data, which provides users with specific services, including data collection, storage and analysis. Due to its lightweight structure, high performance and usable features, together with its seamless integration with the Hadoop and Spark ecosystem, IoTDB meets the requirements of massive dataset storage, high throughput data input, and complex data analysis in the industrial IoT field.

Click for More Information

Main Features

The main features of IoTDB are as follows:

  1. Flexible deployment strategy. IoTDB provides users with a one-click installation tool on either the cloud platform or the terminal devices, and a data synchronization tool bridging the data on cloud platform and terminals.
  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 structures from intelligent networking devices, organization for time series data from devices of the same type, and 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 measurements, computation in time series field (frequency domain transformation) and rich aggregation function support in time dimension.
  6. Easy to get started. IoTDB supports SQL-like language, JDBC standard API and import/export tools which are easy to use.
  7. Seamless integration with state-of-the-practice Open Source Ecosystem. IoTDB supports analysis ecosystems, such as Hadoop and Spark, as well as visualization tools, such as Grafana.

For the latest information about IoTDB, please visit IoTDB official website. If you encounter any problems or identify any bugs while using IoTDB, please report an issue in Jira.

Outline

Quick Start

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

Prerequisites

To use IoTDB, you need to have:

  1. Java >= 1.8 (1.8, 11 to 17 are verified. Please make sure the environment path has been set accordingly).
  2. Maven >= 3.6 (If you want to compile and install IoTDB from source code).
  3. Set the max open files num as 65535 to avoid the "too many open files" error.
  4. (Optional) Set the somaxconn as 65535 to avoid "connection reset" error when the system is under high load.
    # Linux
    > sudo sysctl -w net.core.somaxconn=65535
    
    # FreeBSD or Darwin
    > sudo sysctl -w kern.ipc.somaxconn=65535
    

Linux

(This guide is based on an installation of Ubuntu 22.04.)

Git

Make sure Git is installed, if it's missing, simply install it via:

sudo apt install git

Java

Make sure Java is installed, if it's missing, simply install it via:

sudo apt install default-jdk

Flex

sudo apt install flex

Bison

sudo apt install bison

Boost

sudo apt install libboost-all-dev

OpenSSL header files

Usually OpenSSL is already installed, however it's missing the header files we need to compile. So ensure these are installed:

sudo apt install libssl-dev

Mac OS

Git

First ensure git works.

Usually on a new Mac, as soon as you simply type git in a Terminal window, a popup will come up and ask if you want to finish installing the Mac developer tools. Just say yes. As soon as this is finished, you are free to use git.

Homebrew

Then install Homebrew - If this hasn't been installed yet, as we are going to be installing everything using Homebrew.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Java

As soon as that's done install Java, if this hasn't been installed yet:

brew install java

Depending on your version of Homebrew, it will tell you to do one of the following (depending on the type of processor in your device).

Mainly on the Intel-based models:

sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

Mainly on the ARM-based models:

sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

CPP Prerequisites

Building Thrift requires us to add two more dependencies to the picture.

This however is only needed when enabling the compile-cpp profile:

brew install boost
brew install bison
brew install openssl

Windows

Chocolatey

Then install Chocolatey - If this hasn't been installed yet, as we are going to be installing everything using Chocolatey.

https://chocolatey.org/install

Git

choco install git.install

Java

choco install openjdk

Visual Studio 19 2022

choco install visualstudio2022community
choco install visualstudio2022buildtools
choco install visualstudio2022-workload-nativedesktop

Flex / Bison

choco install winflexbison

Boost

choco install boost-msvc-14.2

OpenSSL

choco install openssl

Installation

IoTDB provides three installation methods, you can refer to the following suggestions, choose the one fits you best:

  • Installation from source code. If you need to modify the code yourself, you can use this method.
  • 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.
  • Using Docker:The path to the dockerfile is here.

Here in the Quick Start, we give a brief introduction of using source code to install IoTDB. For further information, please refer to User Guide.

Build from source

Prepare Thrift compiler

Skip this chapter if you are using Windows.

As we use Thrift for our RPC module (communication and protocol definition), we involve Thrift during the compilation, so Thrift compiler 0.13.0 (or higher) is required to generate Thrift Java code. Thrift officially provides binary compiler for Windows, but unfortunately, they do not provide that for Unix OSs.

If you have permission to install new software, use apt install or yum install or brew install to install the Thrift compiler. (If you already have installed the thrift compiler, skip this step.) Then, you may add the following parameter when running Maven: -Dthrift.download-url=http://apache.org/licenses/LICENSE-2.0.txt -Dthrift.exec.absolute.path=<YOUR LOCAL THRIFT BINARY FILE>.

If not, then you have to compile the thrift compiler, and it requires you install a boost library first. Therefore, we compiled a Unix compiler ourselves and put it onto GitHub, and with the help of a maven plugin, it will be downloaded automatically during compilation. This compiler works fine with gcc8 or later, Ubuntu MacOS, and CentOS, but previous versions and other OSs are not guaranteed.

If you can not download the thrift compiler automatically because of a network problem, you can download it by yourself, and then either: rename your thrift file to {project_root}\thrift\target\tools\thrift_0.12.0_0.13.0_linux.exe; or, add Maven commands: -Dthrift.download-url=http://apache.org/licenses/LICENSE-2.0.txt -Dthrift.exec.absolute.path=<YOUR LOCAL THRIFT BINARY FILE>.

Compile IoTDB

You can download the source code from:

git clone https://github.com/apache/iotdb.git

The default dev branch is the master branch, if you want to use a released version x.x.x:

git checkout vx.x.x

Or checkout to the branch of a big version, e.g., the branch of 1.0 is rel/1.0.

git checkout rel/x.x

Build IoTDB from source

Under the root path of iotdb:

> mvn clean package -pl distribution -am -DskipTests

After being built, the IoTDB distribution is located at the folder: "distribution/target".

Only build cli

Under the iotdb/iotdb-client path:

> mvn clean package -pl cli -am -DskipTests

After being built, the IoTDB cli is located at the folder "cli/target".

Build Others

Use -P compile-cpp for compiling the cpp client. (For more details, read client-cpp's Readme file.)

NOTE: Directories "thrift/target/generated-sources/thrift", "thrift-sync/target/generated-sources/thrift", "thrift-cluster/target/generated-sources/thrift", "thrift-influxdb/target/generated-sources/thrift" and "antlr/target/generated-sources/antlr4" need to be added to sources roots to avoid compilation errors in the IDE.

In IDEA, you just need to right click on the root project name and choose "Maven->Reload Project" after you run mvn package successfully.

Configurations

Configuration files are under the "conf" folder.

  • environment config module (datanode-env.bat, datanode-env.sh),
  • system config module (iotdb-datanode.properties)
  • log config module (logback.xml).

For more information, please see Config Manual.

Start

You can go through the following steps to test the installation. If there is no error returned after execution, the installation is completed.

Start IoTDB

Users can start 1C1D IoTDB by the start-standalone script under the sbin folder.

# Unix/OS X
> sbin/start-standalone.sh

# Windows
> sbin\start-standalone.bat

Use IoTDB

Use Cli

IoTDB offers different ways to interact with server, here we introduce the basic steps of using Cli tool to insert and query data.

After installing IoTDB, there is a default user 'root', its default password is also 'root'. Users can use this default user to login Cli to use IoTDB. The start-up script of Cli is the start-cli script in the folder sbin. When executing the script, user should assign IP, PORT, USER_NAME and PASSWORD. The default parameters are "-h 127.0.0.1 -p 6667 -u root -pw -root".

Here is the command for starting the Cli:

# Unix/OS X
> 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

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

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


IoTDB> login successfully
IoTDB>

Basic commands for IoTDB

Now, let us introduce the way of creating timeseries, inserting data and querying data.

The data in IoTDB is organized as timeseries. Each timeseries includes multiple data–time pairs, and is owned by a database. Before defining a timeseries, we should define a database using CREATE DATABASE first, and here is an example:

IoTDB> CREATE DATABASE root.ln

We can also use SHOW DATABASES to check the database being created:

IoTDB> SHOW DATABASES
+-------------+
|     Database|
+-------------+
|      root.ln|
+-------------+
Total line number = 1

After the database is set, we can use CREATE TIMESERIES to create a new timeseries. When creating a timeseries, we should define its data type and the encoding scheme. Here we create two timeseries:

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

In order to query the specific timeseries, we can use SHOW TIMESERIES . represent the location of the timeseries. The default value is "null", which queries all the timeseries in the system (the same as using "SHOW TIMESERIES root"). Here are some examples:

  1. Querying all timeseries in the system:
IoTDB> SHOW TIMESERIES
+-----------------------------+-----+-------------+--------+--------+-----------+----+----------+
|                   Timeseries|Alias|Database|DataType|Encoding|Compression|Tags|Attributes|
+-----------------------------+-----+-------------+--------+--------+-----------+----+----------+
|root.ln.wf01.wt01.temperature| null|      root.ln|   FLOAT|     RLE|     SNAPPY|null|      null|
|     root.ln.wf01.wt01.status| null|      root.ln| BOOLEAN|   PLAIN|     SNAPPY|null|      null|
+-----------------------------+-----+-------------+--------+--------+-----------+----+----------+
Total line number = 2
  1. Querying a specific timeseries (root.ln.wf01.wt01.status):
IoTDB> SHOW TIMESERIES root.ln.wf01.wt01.status
+------------------------+-----+-------------+--------+--------+-----------+----+----------+
|              timeseries|alias|database|dataType|encoding|compression|tags|attributes|
+------------------------+-----+-------------+--------+--------+-----------+----+----------+
|root.ln.wf01.wt01.status| null|      root.ln| BOOLEAN|   PLAIN|     SNAPPY|null|      null|
+------------------------+-----+-------------+--------+--------+-----------+----+----------+
Total line number = 1

Inserting timeseries data is a basic operation of IoTDB, you can use the ‘INSERT’ command to finish this. Before insertion, you should assign the timestamp and the suffix path name:

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)

The data that you have just inserted will be displayed as follows:

IoTDB> SELECT status FROM root.ln.wf01.wt01
+------------------------+------------------------+
|                    Time|root.ln.wf01.wt01.status|
+------------------------+------------------------+
|1970-01-01T00:00:00.100Z|                    true|
|1970-01-01T00:00:00.200Z|                   false|
+------------------------+------------------------+
Total line number = 2

You can also query several timeseries data using one SQL statement:

IoTDB> SELECT * FROM root.ln.wf01.wt01
+------------------------+-----------------------------+------------------------+
|                    Time|root.ln.wf01.wt01.temperature|root.ln.wf01.wt01.status|
+------------------------+-----------------------------+------------------------+
|1970-01-01T00:00:00.100Z|                         null|                    true|
|1970-01-01T00:00:00.200Z|                        20.71|                   false|
+------------------------+-----------------------------+------------------------+
Total line number = 2

To change the time zone in Cli, you can use the following SQL:

IoTDB> SET time_zone=+08:00
Time zone has set to +08:00
IoTDB> SHOW time_zone
Current time zone: Asia/Shanghai

Add then the query result will show using the new time zone.

IoTDB> SELECT * FROM root.ln.wf01.wt01
+-----------------------------+-----------------------------+------------------------+
|                         Time|root.ln.wf01.wt01.temperature|root.ln.wf01.wt01.status|
+-----------------------------+-----------------------------+------------------------+
|1970-01-01T08:00:00.100+08:00|                         null|                    true|
|1970-01-01T08:00:00.200+08:00|                        20.71|                   false|
+-----------------------------+-----------------------------+------------------------+
Total line number = 2

The commands to exit the Cli are:

IoTDB> quit
or
IoTDB> exit

For more information about the commands supported by IoTDB SQL, please see User Guide.

Stop IoTDB

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

# Unix/OS X
> sbin/stop-standalone.sh

# Windows
> sbin\stop-standalone.bat

The use of CSV Import and Export Tool

see The use of CSV Import and Export Tool

Frequent Questions for Compiling

see Frequent Questions when Compiling the Source Code

Contact Us

QQ Group

  • Apache IoTDB User Group: 659990460

Wechat Group

  • Add friend: tietouqiao or liutaohua001, and then we'll invite you to the group.

Slack

see Join the community for more!

iotdb's People

Contributors

alima777 avatar beyyes avatar caideyipi avatar choubenson avatar cpaulyz avatar crzbulabula avatar dependabot[bot] avatar ericpai avatar fanhualta avatar heimingz avatar hthou avatar jackietien97 avatar jixuan1989 avatar jt2594838 avatar lancelly avatar leirui avatar liukun4515 avatar liuminghui233 avatar marcoszyk avatar myxof avatar neuyilan avatar onesizefitsquorum avatar qiaojialin avatar samperson1997 avatar silvernarcissus avatar spricoder avatar steveyurongsu avatar szywilliam avatar thumarklau avatar xingtanzjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iotdb's Issues

30个设备,每个设备插入1万条记录,重复插入数据后,执行查询select count(*) from root align by device,报错Msg: 500: java.lang.Float cannot be cast to java.lang.Long

我的测试代码如下,连续执行两次,再执行select count(*) from root align by device,就会看到报错信息。

package iotdb;

import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class PerformanceTest {
    public static final String URL = "jdbc:iotdb://192.168.235.101:6667/";
    public static int record = 10000;
    public static int deviceNum = 30;
    private static String startTime = "2020-01-01 00:00:00";
    private static final int BATCH_NUM = 50;
    public static final int INTERVAL = 15;

    public static void createGroup() {
        try (Connection connection = DriverManager.getConnection(URL, "root", "root");
             Statement statement = connection.createStatement()) {
            try {
                statement.execute("SET STORAGE GROUP TO root.org1");
            } catch (Throwable e) {
                e.printStackTrace();
            }
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }

    public static void insert(String startTime) {

        long start = System.currentTimeMillis();

        List<Thread> list = new ArrayList<>();
        for (int i = 0; i < deviceNum; i++) {
            int finalI = i;
            Thread thread = new Thread(() -> {
                try (Connection connection = DriverManager.getConnection(URL, "root", "root");
                     Statement statement = connection.createStatement()) {
                    TimeUtils timeUtils = new TimeUtils();
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                    Date lastTime = sdf.parse(startTime);
                    for (int j = 0; j < record; j++) {
                        String sql = "insert into root.org1.flow.device" + finalI + "(timestamp, forward_flow, reverse_flow, instant_flow) values(" + sdf.format(lastTime) + "," + 100 + "," + 0 + "," + 50 + ")";
                        statement.addBatch(sql);
                        lastTime = timeUtils.addSecond(lastTime, INTERVAL);
                        if (record >= BATCH_NUM && j != 0 && j % BATCH_NUM == 0) {
                            statement.executeBatch();
                            statement.clearBatch();
                            System.out.println("batch insert");
                        }
                    }
                    statement.executeBatch();
                    statement.clearBatch();
                    System.out.println("final batch insert");
                } catch (Throwable e) {
                    e.printStackTrace();
                }

            });
            list.add(thread);


        }
        list.forEach(t -> {
            t.start();
        });

        list.forEach(t -> {
            try {
                t.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });

        long end = System.currentTimeMillis();
        int total = deviceNum * record;
        long ms = end - start;
        System.out.println("insert finished.num:" + total + ",time:" + ms + ",rate:" + total / ms * 1000);
    }

    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        for (int i = 0; i < args.length; i++) {
            String arg = args[i];
            if ("-deviceNum".equalsIgnoreCase(arg)) {
                deviceNum = Integer.parseInt(args[i + 1]);
            } else if ("-record".equalsIgnoreCase(arg)) {
                record = Integer.parseInt(args[i + 1]);
            } else if ("-startTime".equalsIgnoreCase(arg)) {
                startTime = args[i + 1];
            } else {
                continue;
            }
        }

        Class.forName("org.apache.iotdb.jdbc.IoTDBDriver");
        createGroup();
        insert(startTime);
//        query();
    }

    private static void query() {
        try (Connection connection = DriverManager.getConnection(URL, "root", "root");
             Statement statement = connection.createStatement()) {
            ResultSet resultSet = statement.executeQuery("select count(*) from root.org1 align by device");
            outputResult(resultSet);
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }

    private static void outputResult(ResultSet resultSet) throws SQLException {
        if (resultSet != null) {
            System.out.println("--------------------------");
            final ResultSetMetaData metaData = resultSet.getMetaData();
            final int columnCount = metaData.getColumnCount();
            for (int i = 0; i < columnCount; i++) {
                System.out.print(metaData.getColumnLabel(i + 1) + " ");
            }
            System.out.println();
            while (resultSet.next()) {
                for (int i = 1; ; i++) {
                    System.out.print(resultSet.getString(i));
                    if (i < columnCount) {
                        System.out.print(", ");
                    } else {
                        System.out.println();
                        break;
                    }
                }
            }
            System.out.println("--------------------------\n");
        }
    }
}

使用HDFS存储数据,在iotdb-engine.properties中配置core_site_path无效

Describe the bug
想使用HDFS存储数据,在iotdb-engine.properties中core_site_path配置hadoop的core-site.xml路径无效,iotdb还是读取默认文件路径:/etc/hadoop/conf/core-site.xml

查看以下源码发现在TSFileDescriptor类中的没有loadProps方法中没有对coreSitePath和hdfs_site_path重新赋值,
image

麻烦帮忙看一下是否是我自己的配置原因。

(欢迎使用/测试IoTDB的公司在此登记) Welcome to leave your company's info if your company are using/testing IoTDB

Welcome to register by company + homepage (optional) + use case(optional),
your support is important to us.
We will sync to official website periodically (TBD).

欢迎采用/正在测试IoTDB的公司在此登记,您的支持是我们最大的动力。
请按公司名 + 首页(可选) + 应用案例(可选)的格式登记。
后期我们会定期同步至使用公司列表页面。

IoTDB的监控网页异常

使用IoTDB的 0.10.0-SNAPSHOT版本.
IoTDB无数据时,访问IP:8181可以正常显示监控网页,当写入数据后,再次访问,网页报出500异常.
java.lang.NullPointerException
at org.apache.iotdb.db.metrics.ui.MetricsPage.sqlRow(MetricsPage.java:120)
at org.apache.iotdb.db.metrics.ui.MetricsPage.render(MetricsPage.java:83)
at org.apache.iotdb.db.metrics.server.QueryServlet.doGet(QueryServlet.java:42)
查看MetricsPage.java的第120行:

+ "<td>" + (errMsg.equals("") ? "== Parsed Physical Plan ==" : errMsg)

是否为此处errMsg为NULL导致,为何写入数据后会报出异常?

Bug in batch insert

Describe the bug
When we batch insert some data, once an illegal sql occurs, all the sqls after that will not succeed.

To Reproduce

public class JDBCExample {

  public static void main(String[] args) throws ClassNotFoundException, SQLException {
    Class.forName("org.apache.iotdb.jdbc.IoTDBDriver");
    try (Connection connection = DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
        statement.execute("SET STORAGE GROUP TO root.sg1");

        try {
        for (int i = 1; i <= 5; i++) {
          statement.addBatch("insert into root.sg1.d1(timestamp, s1) values("+ i + "," + 1 + ")");
          statement.executeBatch();
          statement.clearBatch();
        }
        statement.addBatch("insert into root.sg1.d1(timestamp, s 2) values("+ 0 + "," + 1 + ")");
        statement.executeBatch();
        statement.clearBatch();
        for (int i = 1; i <= 5; i++) {
          statement.addBatch("insert into root.sg1.d1(timestamp, s2) values("+ i + "," + 1 + ")");
          statement.executeBatch();
          statement.clearBatch();
        }
      } catch (BatchUpdateException e) {
        e.printStackTrace();
      }


      ResultSet resultSet = statement.executeQuery("select * from root where time <= 10");
      outputResult(resultSet);
      resultSet = statement.executeQuery("select count(*) from root");
      outputResult(resultSet);
//      resultSet = statement.executeQuery("select count(*) from root where time >= 1 and time <= 100 group by ([0, 100], 20ms, 20ms)");
//      outputResult(resultSet);
    }
  }

  private static void outputResult(ResultSet resultSet) throws SQLException {
    if (resultSet != null) {
      System.out.println("--------------------------");
      final ResultSetMetaData metaData = resultSet.getMetaData();
      final int columnCount = metaData.getColumnCount();
      for (int i = 0; i < columnCount; i++) {
        System.out.print(metaData.getColumnLabel(i + 1) + " ");
      }
      System.out.println();
      while (resultSet.next()) {
        for (int i = 1; ; i++) {
          System.out.print(resultSet.getString(i));
          if (i < columnCount) {
            System.out.print(", ");
          } else {
            System.out.println();
            break;
          }
        }
      }
      System.out.println("--------------------------\n");
    }
  }
}

Desktop (please complete the following information):

  • OS: MacOS

LIMIT子句与GROUP BY子句组合 0.10.0版本中无效 (can not use "limit" and "group by" together)

Describe the bug
0.10.0版本中 样例数据测试
select count(status), max_value(temperature) from root.ln.wf01.wt01 group by ([2017-11-01T00:00:00, 2017-11-07T23:00:00),1d) limit 5 offset 3

select count(status), max_value(temperature) from root.ln.wf01.wt01 group by ([2017-11-01T00:00:00, 2017-11-07T23:00:00),1d)
结果一致

Expected behavior
文档结果为
image

Screenshots
实际结果

image

Desktop (please complete the following information):

  • Linux 4.18.0-193.el8.x86_64 #1 SMP Fri May 8 10:59:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • /iotdb/sbin/start-cli.sh
  • Version 0.10.0

Additional context
Add any other context about the problem here.

Windows编译生成的apache-iotdb-0.10.0-SNAPSHOT-incubating-bin在Linux下运行服务端报错的解决方案

将Windows下生成的incubator-iotdb\distribution\target\apache-iotdb-0.10.0-SNAPSHOT-incubating-bin拷贝到Linux,使用chmod命令给予start-server.sh权限后,运行start-server.sh可能会报出bad interpreter或者$'\r'这两类错误,如下图:
image

解决方案:
一、更改sbin目录下start-server.sh的脚本格式为Unix

  1. vim apache-iotdb-0.10.0-SNAPSHOT-incubating-bin/sbin/start-server.sh
  2. 在命令模式下,使用命令 :set ff=unix
  3. :wq!保存文件,退出vim

二、同样的操作,更改conf目录下iotdb-env.sh的脚本格式为Unix

再次运行start-server.sh可以发现能够正常运行
参考:解决方案参考网页

IoTDB system load is too large to add timeseries

15万条数据,分散在不同的设备上,
root.20200108.1812022495 -> root.20200108.[设备ID]

出现如下异常

2020-01-08 16:13:21,166 [pool-3-IoTDB-JDBC-Client-thread-2] DEBUG org.apache.iotdb.db.conf.adapter.IoTDBConfigDynamicAdapter:134 - memtableSizeInByte 73717977 is smaller than memTableSizeFloorThreshold 73736192
2020-01-08 16:13:21,167 [pool-3-IoTDB-JDBC-Client-thread-2] ERROR org.apache.iotdb.db.service.TSServiceImpl:1276 - IoTDB: error occurs when executing statements
org.apache.iotdb.db.exception.query.QueryProcessException: IoTDB system load is too large to add timeseries
at org.apache.iotdb.db.qp.executor.QueryProcessExecutor.insertBatch(QueryProcessExecutor.java:301)
at org.apache.iotdb.db.service.TSServiceImpl.insertBatch(TSServiceImpl.java:1257)
at org.apache.iotdb.service.rpc.thrift.TSIService$Processor$insertBatch.getResult(TSIService.java:1705)
at org.apache.iotdb.service.rpc.thrift.TSIService$Processor$insertBatch.getResult(TSIService.java:1690)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2020-01-08 16:13:21,167 [pool-3-IoTDB-JDBC-Client-thread-2] DEBUG org.apache.iotdb.db.conf.adapter.IoTDBConfigDynamicAdapter:134 - memtableSizeInByte 73717977 is smaller than memTableSizeFloorThreshold 73736192
2020-01-08 16:13:21,168 [pool-3-IoTDB-JDBC-Client-thread-2] ERROR org.apache.iotdb.db.service.TSServiceImpl:1276 - IoTDB: error occurs when executing statements

start-server.bat quits unexpectedly in Windows

The Problem
After compilation, double clicking the "start-server.bat" results in quitting unexpectedly.

Possible solution

  • Windows fails to execute when the path of "lib" is too long. In this case, copy the whole folder "iotdb-server-0.10.0-SNAPSHOT" to wherever the path is shorter, and then try executing the "start-server.bat" again.

元数据树里的节点如何添加属性信息

每个测点除了必要的时序数据外还有一些固定的属性数据也很重要,但是目前Iotdb无法管理属性数据。
可以针对属性进行过滤和查询,如果缺失这个功能的话,客户使用中就不得不引入第三方方案,有些不便利。比如:
图片
图片

图中展示的仅仅是部分属性,就是针对这些属性,如果是文本要支持模糊查询,数字的话支持比较过滤,但类似单位(比如)这种属性就不做要求。

0.10.0版本CentOS7.8由于gcc版本过低导致编译失败的问题 (compiling IoTDB server failed because GLIBCXX version not found on Linux)

使用maven编译server代码时失败

首先给出问题的截图
批注 2020-07-01 210508
22222222222

1、首先怀疑是我没有在CentOS7上安装thrift,于是去安装,然后编译还是出现同样的错误。
2、仔细查看报错信息“version `GLIBCXX_3.4.20' not found”,怀疑是gcc版本问题导致编译不过。
参考 https://www.bbsmax.com/A/6pdDOoOD5w/ 这篇博客的方法,从本机上复制 已有的libstdc++.so.6.0.20 到指定目录下,并重新软链接。
注意:CentOS7.8上没有libstdc++.so.6.0.20,但我在安装Anaconda时anaconda为我下载了libstdc++.so.6.0.25,我尝试将.25版本的复制过去,再用maven编译,编译通过。

SQL执行时间怎样优化到毫秒级别?还是说根本就不可能?

data count: 18999994 total
SQL: select * from root.position where time > 1559179819000 limit 10
执行上述sql:
shell client显示花费时间: 6.171S
image

IOTDB Metrics Server:0-7ms??????????
image

为什么两者差别如此之大?
我还尝试使用jdbc api,时间花费在5s,我以为查询会很强,没想到这么弱,感觉比不上HBase...

这是你们的产品介绍,我不知道是否是我的用法有问题,查询根本做不到毫秒级别,超过300W数据就已经是秒级别了,官网的文档也不详细,基本的性能调优我都没有找到。

求解惑,还有尽快完善文档吧,连集群模式都没有,生产谁敢用...

python paho mqtt library does not require verification when inserting data through the mqtt protocol

一、我修改了root用户密码,并且重启了server
二、使用 python paho mqtt 插入数据时,没有设置用户名和密码相关参数
三、但是我仍然成功的插入了数据 -_-!!!

iotdb version: 0.10.0
paho mqtt: 1.5.0 (pip install paho-mqtt)

代码如下:

from time import *
import paho.mqtt.publish as publish


def timestamp():
    return int(round(time() * 1000))


def single(tx_id: str, log_type: str, log_content: str, hostname: str = "192.168.3.181", port: int = 1883):
    device_id = "root.log.%s" % tx_id
    payload = "{\n" "\"device\":\"%s\",\n" "\"timestamp\":%d,\n" "\"measurements\":[\"type\",\"content\"],\n" "\"values" \
              "\":[\"%s\",\"%s\"]\n" "}" % (device_id, timestamp(), log_type, log_content)
    publish.single(topic=device_id, payload=payload, hostname=hostname, port=port)


if __name__ == '__main__':
    type_list = ["INFO", "WARNING", "ERROR"]
    content_list = ["自动上报: 组件不完整", "日志同步", "命令长度校验失败", "配置参数有误"]
    begin_time = time()
    for i in range(10):
        single("1411111111", type_list[i % len(type_list)], content_list[i % len(content_list)])
    end_time = time()
    run_time = end_time - begin_time
    print('该循环程序运行时间:', run_time)

您好,请问一下我操作java API获取表字段类型的时候有问题? (How to get series data type using Java API)

// 当 columnPattern 为"root.*"的时候,可以获得所有的列名
// 当columnPattern为某一列(如"root.sgcc.wf03.wt01.temperature")的时候,可以获得
该列的数据类型
public ResultSet getColumns(String catalog, String schemaPattern, String
columnPattern, String deltaObjectPattern)
请问一下咱们这个版本还有维护这个API吗?我这边获取的resultset为null,能帮忙看看吗,谢谢了

启动报错(跳过有问题的元数据日志,不影响重启)

[root@localhost sbin]# ./start-server.sh &
[1] 10397
[root@localhost sbin]# ---------------------
Starting IoTDB

Maximum memory allocation pool = 4096MB, initial memory allocation pool = 800MB
If you want to change this configuration, please check conf/iotdb-env.sh(Unix or OS X, if you use Windows, check conf/iotdb-env.bat).
2020-05-22 18:43:19,086 [main] INFO org.apache.iotdb.db.conf.IoTDBDescriptor:91 - Start to read config file ./../conf/iotdb-engine.properties
2020-05-22 18:43:19,089 [main] INFO org.apache.iotdb.db.conf.IoTDBDescriptor:111 - The stat_monitor_detect_freq_sec value is smaller than default, use default value
2020-05-22 18:43:19,090 [main] INFO org.apache.iotdb.db.conf.IoTDBDescriptor:118 - The stat_monitor_retain_interval_sec value is smaller than default, use default value
2020-05-22 18:43:19,090 [main] INFO org.apache.iotdb.db.conf.IoTDBDescriptor:228 - Time zone has been set to +08:00
2020-05-22 18:43:19,093 [main] INFO org.apache.iotdb.tsfile.common.conf.TSFileDescriptor:103 - Start to read config file ./../conf/iotdb-engine.properties
2020-05-22 18:43:19,095 [main] INFO org.apache.iotdb.db.conf.IoTDBConfigCheck:54 - System configuration is ok.
2020-05-22 18:43:19,097 [main] INFO org.apache.iotdb.db.service.StartupChecks:47 - JMX is enabled to receive remote connection on port 31999
2020-05-22 18:43:19,097 [main] INFO org.apache.iotdb.db.service.StartupChecks:57 - JDK veriosn is 8.
2020-05-22 18:43:19,098 [main] INFO org.apache.iotdb.db.service.IoTDB:80 - Setting up IoTDB...
2020-05-22 18:43:19,111 [main] ERROR org.apache.iotdb.db.concurrent.IoTDBDefaultThreadExceptionHandler:31 - Exception in thread main-1
java.lang.ArrayIndexOutOfBoundsException: 1
at org.apache.iotdb.db.metadata.MManager.operation(MManager.java:217)
at org.apache.iotdb.db.metadata.MManager.initFromLog(MManager.java:177)
at org.apache.iotdb.db.metadata.MManager.init(MManager.java:149)
at org.apache.iotdb.db.service.IoTDB.initMManager(IoTDB.java:121)
at org.apache.iotdb.db.service.IoTDB.setUp(IoTDB.java:92)
at org.apache.iotdb.db.service.IoTDB.active(IoTDB.java:69)
at org.apache.iotdb.db.service.IoTDB.main(IoTDB.java:55)
2020-05-22 18:43:19,114 [Thread-1] INFO org.apache.iotdb.db.service.IoTDBShutdownHook:32 - IoTDB exits. Jvm memory usage: 0 GB 40 MB 104 KB 256 B

我这里主要存zabbix监控信息,使用了一个存储组,每1分钟存2000条时序数据,我应该调整哪些内存参数?我现在使用1台4核16G机器。

我修改了iotdb-env.sh中的配置:
half_system_memory_in_mb=expr $system_memory_in_mb / 2
quarter_system_memory_in_mb=expr $half_system_memory_in_mb / 2
if [ "$half_system_memory_in_mb" -gt "1024" ]
then
half_system_memory_in_mb="4096"
fi
if [ "$quarter_system_memory_in_mb" -gt "8192" ]
then
quarter_system_memory_in_mb="8192"
fi
if [ "$half_system_memory_in_mb" -gt "$quarter_system_memory_in_mb" ]
then
max_heap_size_in_mb="$half_system_memory_in_mb"
else
max_heap_size_in_mb="$quarter_system_memory_in_mb"
fi
MAX_HEAP_SIZE="${max_heap_size_in_mb}M"

# Young gen: min(max_sensible_per_modern_cpu_core * num_cores, 1/4 * heap size)
max_sensible_yg_per_core_in_mb="200"
max_sensible_yg_in_mb=`expr $max_sensible_yg_per_core_in_mb "*" $system_cpu_cores`

desired_yg_in_mb=`expr $max_heap_size_in_mb / 4`

if [ "$desired_yg_in_mb" -gt "$max_sensible_yg_in_mb" ]
then
    HEAP_NEWSIZE="${max_sensible_yg_in_mb}M"
else
    HEAP_NEWSIZE="${desired_yg_in_mb}M"
fi

请问这个问题如何解决?

IoTDB-HDFS模式 频繁出错

将IoTDB的存储模式改为HDFS后成功运行,我写了一个不断插入数据的脚本,在脚本运行时手动随机查询数据,频繁报500的错误。有两种提示信息。

  1. IoTDB> select * from root.XXX.device1 where time=1594870403417
    Msg: 500: null
  2. IoTDB> select * from root.XXX.device1 where time=1594870403417
    Msg: 500: Cannot seek after EOF
    这个时间戳是实际插入了的

后台日志信息如下:
2020-07-16 14:52:32,783 [pool-7-IoTDB-Query-ServerServiceImpl-thread-10] ERROR org.apache.iotdb.db.query.dataset.RawQueryDataSetWithoutValueFilter$ReadTask:107 - Something gets wrong:
java.nio.BufferUnderflowException: null
at java.nio.Buffer.nextGetIndex(Buffer.java:506)
at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:364)
at org.apache.iotdb.tsfile.file.header.ChunkHeader.deserializeFrom(ChunkHeader.java:118)
at org.apache.iotdb.tsfile.read.TsFileSequenceReader.readChunkHeader(TsFileSequenceReader.java:659)
at org.apache.iotdb.tsfile.read.TsFileSequenceReader.readMemChunk(TsFileSequenceReader.java:681)
at org.apache.iotdb.db.engine.cache.ChunkCache.get(ChunkCache.java:122)
at org.apache.iotdb.db.query.reader.chunk.DiskChunkLoader.loadChunk(DiskChunkLoader.java:46)
at org.apache.iotdb.db.utils.FileLoaderUtils.loadPageReaderList(FileLoaderUtils.java:150)
at org.apache.iotdb.db.query.reader.series.SeriesReader.unpackOneChunkMetaData(SeriesReader.java:377)
at org.apache.iotdb.db.query.reader.series.SeriesReader.unpackAllOverlappedChunkMetadataToCachedPageReaders(SeriesReader.java:368)
at org.apache.iotdb.db.query.reader.series.SeriesReader.hasNextPage(SeriesReader.java:317)
at org.apache.iotdb.db.query.reader.series.SeriesRawDataBatchReader.readPageData(SeriesRawDataBatchReader.java:151)
at org.apache.iotdb.db.query.reader.series.SeriesRawDataBatchReader.readChunkData(SeriesRawDataBatchReader.java:143)
at org.apache.iotdb.db.query.reader.series.SeriesRawDataBatchReader.hasNextBatch(SeriesRawDataBatchReader.java:98)
at org.apache.iotdb.db.query.dataset.RawQueryDataSetWithoutValueFilter$ReadTask.runMayThrow(RawQueryDataSetWithoutValueFilter.java:67)
at org.apache.iotdb.db.concurrent.WrappedRunnable.run(WrappedRunnable.java:32)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

时间戳越靠前报错几率越大,也就是说新插入的时间戳出现这个错误的几率不大

Msg: 500: all cached chunks should be consumed first

你好请问,这个是因为什么原因导致的?

IoTDB> SELECT max_time(5452) FROM root.lin.l1.18_0 where time < 1590388748190 and time > 1590016639981 GROUP BY([1590016639981, 1590088748190), 1m)
Msg: 500: all cached chunks should be consumed first

能不能增加更多的设计文档

你好,非常荣幸看到你们的项目!

我了解到目前该数据库已经拥有了非常好的性能表现,我也非常想参与其中!但是我没有找到关于iotdb详细的解释,能够让我在打开一个具体类的时候,知道我在改动整个数据库里的哪一块,并且它的上下游都分别会影响什么!

能不能增加一个清晰的类似于导航地图一样的图或文档帮助我们理解!
谢谢

root密码修改不成功

ALTER USER root SET PASSWORD '123456';
修改密码报错;

ALTER USER testSET PASSWORD '123456';
其他用户就能修改成功,为啥子??

"StorageEngineFailureException" after reboot IOTDB-0.9.3

Describe the bug
IOTDB重启后无法登录,抛出StorageEngineFailureException

To Reproduce

  1. 凌晨3点左右IOTDB报警 , GC overhead limit exceeded
  2. 7点丢失与IOTDB的心跳
  3. 10点左右试图CLI登录IOTDB失败,遂重启
  4. IOTDB重启后依旧无法登录,抛出StorageEngineFailureException

Screenshots
2020_1

Desktop

  • OS: windows server
  • Version: 0.9.3

同一个连接上多线程插入数据报错 (Concurrency error when multiply threads use the same JDBC connection.)

我的测试代码如下:
`
package iotdb;
import java.sql.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class PerformanceTest2 {
public static final String URL = "jdbc:iotdb://192.168.235.101:6667/";
public static final int RECORD = 1000;
public static final int DEVICE_NUM = 10;
private static final int BATCH_NUM = 50;
public static final int INTERVAL = 15;

public static void createGroup() {
    try (Connection connection = DriverManager.getConnection(URL, "root", "root");
         Statement statement = connection.createStatement()) {
        try {
            statement.execute("SET STORAGE GROUP TO root.org1");
        } catch (Throwable e) {
            e.printStackTrace();
        }
    } catch (Throwable e) {
        e.printStackTrace();
    }
}

public static void insert(String startTime) {


    List<Thread> list = new ArrayList<>();
    try (Connection connection = DriverManager.getConnection(URL, "root", "root");
         Statement statement = connection.createStatement()) {
        for (int i = 0; i < DEVICE_NUM; i++) {
            int finalI = i;
            Thread thread = new Thread(() -> {
                try {
                    TimeUtils timeUtils = new TimeUtils();
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                    Date lastTime = sdf.parse(startTime);
                    for (int j = 0; j < RECORD; j++) {
                        String sql = "insert into root.org1.flow.device" + finalI + "(timestamp, forward_flow, reverse_flow, instant_flow) values(" + sdf.format(lastTime) + "," + 100 + "," + 0 + "," + 50 + ")";
                        statement.addBatch(sql);
                        lastTime = timeUtils.addSecond(lastTime, INTERVAL);
                        if (RECORD >= BATCH_NUM && j != 0 && j % BATCH_NUM == 0) {
                            statement.executeBatch();
                            statement.clearBatch();
                            System.out.println("batch insert");
                        }
                    }
                    statement.executeBatch();
                    statement.clearBatch();
                    System.out.println("final batch insert");
                } catch (Throwable e) {
                    e.printStackTrace();
                }
            });
            list.add(thread);
        }
        list.forEach(t -> {
            t.start();
        });

        list.forEach(t -> {
            try {
                t.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        System.out.println("insert finished.");
    } catch (Throwable e) {
        e.printStackTrace();
    }
}

public static void main(String[] args) throws ClassNotFoundException, SQLException {
    Class.forName("org.apache.iotdb.jdbc.IoTDBDriver");
    createGroup();
    insert("2020-01-01 00:00:00");
    query();
}

private static void query() {
    try (Connection connection = DriverManager.getConnection(URL, "root", "root");
         Statement statement = connection.createStatement()) {
        ResultSet resultSet = statement.executeQuery("select count(*) from root.org1");
        outputResult(resultSet);
    } catch (Throwable e) {
        e.printStackTrace();
    }
}

private static void outputResult(ResultSet resultSet) throws SQLException {
    if (resultSet != null) {
        System.out.println("--------------------------");
        final ResultSetMetaData metaData = resultSet.getMetaData();
        final int columnCount = metaData.getColumnCount();
        for (int i = 0; i < columnCount; i++) {
            System.out.print(metaData.getColumnLabel(i + 1) + " ");
        }
        System.out.println();
        while (resultSet.next()) {
            for (int i = 1; ; i++) {
                System.out.print(resultSet.getString(i));
                if (i < columnCount) {
                    System.out.print(", ");
                } else {
                    System.out.println();
                    break;
                }
            }
        }
        System.out.println("--------------------------\n");
    }
}

}
`

报错信息如下:
java.sql.SQLException: Error occurs when closing statement. at org.apache.iotdb.jdbc.IoTDBStatement.closeClientOperation(IoTDBStatement.java:150) at org.apache.iotdb.jdbc.IoTDBStatement.close(IoTDBStatement.java:160) at iotdb.PerformanceTest2.insert(PerformanceTest2.java:94) at iotdb.PerformanceTest2.main(PerformanceTest2.java:102) Suppressed: java.sql.SQLException: Error occurs when closing session at server. Maybe server is down. at org.apache.iotdb.jdbc.IoTDBConnection.close(IoTDBConnection.java:120) ... 2 more Caused by: org.apache.thrift.transport.TTransportException: Cannot write to null outputStream at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:140) at org.apache.thrift.protocol.TBinaryProtocol.writeI32(TBinaryProtocol.java:202) at org.apache.thrift.protocol.TBinaryProtocol.writeMessageBegin(TBinaryProtocol.java:117) at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:70) at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62) at org.apache.iotdb.service.rpc.thrift.TSIService$Client.send_closeSession(TSIService.java:182) at org.apache.iotdb.service.rpc.thrift.TSIService$Client.closeSession(TSIService.java:174) at org.apache.iotdb.jdbc.IoTDBConnection.close(IoTDBConnection.java:118) ... 2 more Caused by: org.apache.thrift.transport.TTransportException: Cannot write to null outputStream at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:140) at org.apache.thrift.protocol.TBinaryProtocol.writeI32(TBinaryProtocol.java:202) at org.apache.thrift.protocol.TBinaryProtocol.writeMessageBegin(TBinaryProtocol.java:117) at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:70) at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62) at org.apache.iotdb.service.rpc.thrift.TSIService$Client.send_closeOperation(TSIService.java:366) at org.apache.iotdb.service.rpc.thrift.TSIService$Client.closeOperation(TSIService.java:358) at org.apache.iotdb.jdbc.IoTDBStatement.closeClientOperation(IoTDBStatement.java:145) ... 3 more

timeseries 元数据tag、attribute目前不支持修改、删除、新增

create timeseries root.turbine.d1.s1(temprature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)
目前支持在新建timeseries 的时候可以添加tag等标签信息,但一旦实施人员疏忽或需求变化,前期添加的tag信息就没法更新,除非删除timeseries重新建,这样涉及到已有数据是不能删除的,因此很麻烦,需要类似如下的功能:
alter timeseries root.turbine.d1.s1 change tag1 newV1
alter timeseries root.turbine.d1.s1 add tag3 v3
alter timeseries root.turbine.d1.s1 drop tag2

这样就可以方便的管理这些信息而不用删除数据

Connection timed out: connect 连接超时

微信图片_20200507105144
微信图片_20200507105154
微信图片_20200507105157
上面是我的定时测试程序
Connection timed out: connect这个问题昨天晚上到现在运行了十几个小时,出现了3次,但是不影响下次写入
客户端以及服务端版本是0.9.2
logs.zip

client工具查询异常

0.10.0-SNAPSHOT版本
client工具先执行错误SQL再执行正确SQL后,返回的数据异常.
步骤如下:

  1. 使用JDBC Example代码向root.demo.s0到root.demo.s29,共30个时间序列,各写入1000000个数据.

  2. 使用client工具连接到server.

  3. 执行 select count(s0) from root.demo,结果为1000000,此结果正确.

  4. 连续输入并执行错误的SQL语句:

  • select count(s0,s1) from root.demo
    (Msg: Index 0 out of bounds for length 0)
  • select count(*) from root.demo.s0
    (Msg: 401: line 1:15 missing ')' at ',')
  1. 执行 select count(s0) from root.demo,此时返回的结果为:Empty set.此结果错误.

  2. 执行 select count(s0) from root.demo,结果为1000000,结果又变为正确.

此现象是否存在异常?

failed to insert data using python paho mqtt library

使用 python paho mqtt 插入数据时出现错误:
client_id不能为空,且qos必须等于0,不然就会出现错误。

qos=1 or 2, 则会出现如下错误,结果就是预期应该插入10W条数据的结果只插入了20条数据
image

iotdb version: 0.10.0
paho-mqtt: 1.5.0

代码如下

import random

import paho.mqtt.client as mqtt
import time


def on_connect(client, userdata, flags, rc):
    print("Connected with result code: " + str(rc))


def on_message(client, userdata, msg):
    print(msg.topic + " " + str(msg.payload))


client = mqtt.Client(client_id=str(random.uniform(1, 10)))
# client = mqtt.Client()
client.username_pw_set("root", "root")
client.connect('127.0.0.1', 1883)

timestamp = lambda: int(round(time.time() * 1000))
for i in range(100000):
    message = "{\n" "\"device\":\"root.log.d1\",\n" "\"timestamp\":%d,\n" "\"measurements\":[\"s1\"],\n" "\"values" \
              "\":[%f]\n" "}" % (timestamp() + 1000 * i, random.uniform(1, 10))
    client.publish('root.log.d1.info', payload=message, qos=0, retain=False)
client.disconnect()

可以对别名做upsert吗

ALTER timeseries root.turbine1.d1.s1 UPSERT ALIAS=p00001 TAGS(tag2=newV2, tag3=v3) ATTRIBUTES(attr3=v3, attr4=v4),
目前注册timeseries时候可以添加别名,但没法修改,可以保证别名在该设备下命名唯一的情况下upsert

在timeries下再创建子节点bug (Bug when creating another child node on a time serie node)

使用的是0.10版本。
在已有的timeries(root.ln.device1.s1)下再创建一个timeries,如root.ln.device1.s1.signal_value。在jdbc和cli下出现不同的结果。
1)JDBC下这么运行后 ,会造成服务卡死。打印的错误日志:
java.lang.ClassCastException: org.apache.iotdb.db.metadata.mnode.LeafMNode cannot be cast to org.apache.iotdb.db.metadata.mnode.InternalMNode

2)Cli下能成功执行,但是会将root.ln.device1.s1同级的timeries都屏蔽了,结果如下图:
IoTDB> show timeseries root.ln
+-------------+-----+-------------+--------+--------+-----------+
| timeseries|alias|storage group|dataType|encoding|compression|
+-------------+-----+-------------+--------+--------+-----------+
|root.ln.jgy.1| null| root.ln| FLOAT| GORILLA| SNAPPY|
|root.ln.jgy.2| null| root.ln| FLOAT| GORILLA| SNAPPY|
+-------------+-----+-------------+--------+--------+-----------+
Total line number = 2
It costs 0.022s
IoTDB> create timeseries root.ln.jgy.2.signal_value with datatype=FLOAT,encoding=GORILLA
IoTDB> show timeseries root.ln
+--------------------------+-----+-------------+--------+--------+-----------+
| timeseries|alias|storage group|dataType|encoding|compression|
+--------------------------+-----+-------------+--------+--------+-----------+
|root.ln.jgy.2.signal_value| null| root.ln| FLOAT| GORILLA| SNAPPY|
+--------------------------+-----+-------------+--------+--------+-----------+

这个是不是应该直接不允许在timeseries下再次创建timeseries

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.