一、前言
之前在搞监控时,曾学习和测试过InfluxDB数据库,第一次接触时序数据库,也深深感受到了时序数据库的块,最近在墨天轮上看到对国产库时序数据库(Time Series Database)的介绍,特别是看了涛思数据库创世人陶总的采访,真的挺钦佩陶总的三次创业历程,现在又把涛思数据库搞的这么好。也很想好好了解和学习下这款国产时序数据库,也希望能和InfluxDB数据库做个对比,希望能在后面的一些项目中使用该数据库,于是在公司测试环境尝试使用二进制安装测试下该数据库。
二、安装数据库
本次安装所选用的操作系统是Centos 7.9 x86_64位操作系统,使用root用户安装。
2.1 下载安装包
登录TDengine数据库官网(https://www.taosdata.com/)
点击产品,如下图,
选择“TDengine 社区版”,
选择“快速上手”,
选择“安装包”,然后选择tar.gz安装,然后点击“TDengine-server-3.0.4.2-Linux-x64.tar.gz”下载。
弹出一个对话框,根据要求填写邮箱地址,
然后点击“下载”,会弹出一个信息框,如下,
然后打开邮箱,查看接收到的邮件信息,如下:
然后点击“这个链接”按钮,就会下载二进制安装包。
1.2 安装数据库
将下载好的安装包TDengine-server-3.0.4.2-Linux-x64.tar.gz上传至服务器某个目录下,比如/home/soft目录下,解压数据库安装包。
1) 解压安装包
# 解压数据库安装包 使用-v参数可以详细查看安装包都含哪些具体信息
[root@xsky-node4 soft]# tar -zxvf TDengine-server-3.0.4.2-Linux-x64.tar.gz
TDengine-server-3.0.4.2/
TDengine-server-3.0.4.2/package.tar.gz
TDengine-server-3.0.4.2/install.sh
TDengine-server-3.0.4.2/examples/
TDengine-server-3.0.4.2/examples/c/
TDengine-server-3.0.4.2/examples/c/CMakeLists.txt
TDengine-server-3.0.4.2/examples/c/asyncdemo.c
TDengine-server-3.0.4.2/examples/c/demo.c
TDengine-server-3.0.4.2/examples/c/makefile
TDengine-server-3.0.4.2/examples/c/prepare.c
TDengine-server-3.0.4.2/examples/c/schemaless.c
TDengine-server-3.0.4.2/examples/c/stream_demo.c
TDengine-server-3.0.4.2/examples/c/tmq.c
TDengine-server-3.0.4.2/examples/JDBC/
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/README-jdbc-windows.md
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/pom.xml
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/readme.md
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/src/
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/src/main/
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/src/main/java/
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/src/main/java/com/
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/JdbcDemo.java
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/JdbcRestfulDemo.java
TDengine-server-3.0.4.2/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/SubscribeDemo.java
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/.gitignore
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/pom.xml
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/readme.md
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata/example/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata/example/jdbcTemplate/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata/example/jdbcTemplate/App.java
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata/example/jdbcTemplate/dao/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata/example/jdbcTemplate/dao/ExecuteAsStatement.java
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata/example/jdbcTemplate/dao/ExecuteAsStatementImpl.java
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata/example/jdbcTemplate/dao/WeatherDao.java
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata/example/jdbcTemplate/dao/WeatherDaoImpl.java
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata/example/jdbcTemplate/domain/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata/example/jdbcTemplate/domain/Weather.java
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/resources/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/main/resources/applicationContext.xml
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/test/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/test/java/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/test/java/com/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/test/java/com/taosdata/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/test/java/com/taosdata/example/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/test/java/com/taosdata/example/jdbcTemplate/
TDengine-server-3.0.4.2/examples/JDBC/SpringJdbcTemplate/src/test/java/com/taosdata/example/jdbcTemplate/BatcherInsertTest.java
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/README-cn.md
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/pom.xml
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/taosdata/
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/ConnectionPoolDemo.java
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/ProxoolDemo.java
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/common/
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/common/InsertTask.java
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/C3p0Builder.java
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/DbcpBuilder.java
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/DruidPoolBuilder.java
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/HikariCpBuilder.java
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/resources/
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/resources/log4j.properties
TDengine-server-3.0.4.2/examples/JDBC/connectionPools/src/main/resources/proxool.xml
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/.gitignore
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/.mvn/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/.mvn/wrapper/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/.mvn/wrapper/MavenWrapperDownloader.java
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/.mvn/wrapper/maven-wrapper.jar
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/.mvn/wrapper/maven-wrapper.properties
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/mvnw
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/mvnw.cmd
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/pom.xml
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/readme
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/MybatisplusDemoApplication.java
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/config/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/config/MybatisPlusConfig.java
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/domain/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/domain/Temperature.java
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/domain/Weather.java
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/mapper/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/mapper/TemperatureMapper.java
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/mapper/WeatherMapper.java
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/resources/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/main/resources/application.yml
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/test/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/test/java/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/test/java/com/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/test/java/com/taosdata/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/test/java/com/taosdata/example/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/test/java/com/taosdata/example/mybatisplusdemo/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/test/java/com/taosdata/example/mybatisplusdemo/mapper/
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/test/java/com/taosdata/example/mybatisplusdemo/mapper/TemperatureMapperTest.java
TDengine-server-3.0.4.2/examples/JDBC/mybatisplus-demo/src/test/java/com/taosdata/example/mybatisplusdemo/mapper/WeatherMapperTest.java
TDengine-server-3.0.4.2/examples/JDBC/readme.md
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/.gitignore
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/mvnw
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/mvnw.cmd
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/pom.xml
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/readme.md
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/SpringbootdemoApplication.java
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/controller/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/controller/WeatherController.java
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/dao/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/dao/WeatherMapper.java
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/dao/WeatherMapper.xml
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/domain/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/domain/Weather.java
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/service/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/service/WeatherService.java
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/util/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/util/TaosAspect.java
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/resources/
TDengine-server-3.0.4.2/examples/JDBC/springbootdemo/src/main/resources/application.properties
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/.gitignore
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/.mvn/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/.mvn/wrapper/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/.mvn/wrapper/MavenWrapperDownloader.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/.mvn/wrapper/maven-wrapper.jar
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/.mvn/wrapper/maven-wrapper.properties
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/mvnw
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/mvnw.cmd
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/pom.xml
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/readme.md
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/TaosDemoApplication.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/components/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/components/DataSourceFactory.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/components/JdbcTaosdemoConfig.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/components/JsonConfig.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/dao/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/dao/DatabaseMapper.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/dao/DatabaseMapperImpl.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/dao/SubTableMapper.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/dao/SubTableMapperImpl.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/dao/SuperTableMapper.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/dao/SuperTableMapperImpl.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/dao/TableMapper.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/dao/TableMapperImpl.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/domain/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/domain/FieldMeta.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/domain/FieldValue.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/domain/RowValue.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/domain/SubTableMeta.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/domain/SubTableValue.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/domain/SuperTableMeta.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/domain/TableMeta.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/domain/TableValue.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/domain/TagMeta.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/domain/TagValue.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/AbstractService.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/DatabaseService.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/QueryService.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/SqlExecuteTask.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/SubTableService.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/SuperTableService.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/TableService.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/data/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/data/FieldValueGenerator.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/data/SubTableMetaGenerator.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/data/SubTableValueGenerator.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/data/SuperTableMetaGenerator.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/data/TagValueGenerator.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/utils/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/utils/DataGenerator.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/utils/Printer.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/utils/SqlSpeller.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/utils/TaosConstants.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/utils/TimeStampUtil.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/resources/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/resources/application.properties
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/resources/insert.json
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/resources/log4j.properties
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/resources/query.json
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/resources/templates/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/main/resources/templates/index.html
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/service/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/service/DatabaseServiceTest.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/service/QueryServiceTest.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/service/SubTableServiceTest.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/service/SuperTableServiceTest.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/service/data/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/service/data/FieldValueGeneratorTest.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/service/data/SubTableMetaGeneratorTest.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/service/data/SuperTableMetaGeneratorImplTest.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/service/data/TagValueGeneratorTest.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/utils/
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/utils/DataGeneratorTest.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/utils/SqlSpellerTest.java
TDengine-server-3.0.4.2/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/utils/TimeStampUtilTest.java
TDengine-server-3.0.4.2/examples/matlab/
TDengine-server-3.0.4.2/examples/matlab/TDengineDemo.m
TDengine-server-3.0.4.2/examples/python/
TDengine-server-3.0.4.2/examples/python/PYTHONConnectorChecker/
TDengine-server-3.0.4.2/examples/python/PYTHONConnectorChecker/PythonChecker.py
TDengine-server-3.0.4.2/examples/python/read_example.py
TDengine-server-3.0.4.2/examples/python/taosdemo/
TDengine-server-3.0.4.2/examples/python/taosdemo/README.md
TDengine-server-3.0.4.2/examples/python/taosdemo/requirements.txt
TDengine-server-3.0.4.2/examples/python/taosdemo/taosdemo.py
TDengine-server-3.0.4.2/examples/R/
TDengine-server-3.0.4.2/examples/R/command.txt
TDengine-server-3.0.4.2/examples/go/
TDengine-server-3.0.4.2/examples/go/taosdemo.go
TDengine-server-3.0.4.2/examples/nodejs/
TDengine-server-3.0.4.2/examples/nodejs/README-win.md
TDengine-server-3.0.4.2/examples/nodejs/nodejsChecker.js
TDengine-server-3.0.4.2/examples/C#/
TDengine-server-3.0.4.2/examples/C#/C#checker/
TDengine-server-3.0.4.2/examples/C#/C#checker/C#checker.cs
TDengine-server-3.0.4.2/examples/C#/C#checker/TDengineDriver.cs
TDengine-server-3.0.4.2/examples/C#/TDengineDriver.cs
TDengine-server-3.0.4.2/examples/C#/TDengineTest.cs
TDengine-server-3.0.4.2/examples/C#/taosdemo/
TDengine-server-3.0.4.2/examples/C#/taosdemo/Dockerfile
TDengine-server-3.0.4.2/examples/C#/taosdemo/README.md
TDengine-server-3.0.4.2/examples/C#/taosdemo/TDengineDriver.cs
TDengine-server-3.0.4.2/examples/C#/taosdemo/taosdemo.cs
TDengine-server-3.0.4.2/examples/C#/taosdemo/taosdemo.csproj
TDengine-server-3.0.4.2/examples/taosbenchmark-json/
TDengine-server-3.0.4.2/examples/taosbenchmark-json/insert_csv.json
TDengine-server-3.0.4.2/examples/taosbenchmark-json/insert-from-to.json
TDengine-server-3.0.4.2/examples/taosbenchmark-json/insert.json
TDengine-server-3.0.4.2/examples/taosbenchmark-json/insert-rest.json
TDengine-server-3.0.4.2/examples/taosbenchmark-json/insert-with-partial-columns.json
TDengine-server-3.0.4.2/examples/taosbenchmark-json/query.json
TDengine-server-3.0.4.2/examples/taosbenchmark-json/query-sqls.txt
TDengine-server-3.0.4.2/examples/taosbenchmark-json/query-with-file.json
TDengine-server-3.0.4.2/examples/taosbenchmark-json/sample.csv
TDengine-server-3.0.4.2/examples/taosbenchmark-json/sample_tag.csv
TDengine-server-3.0.4.2/examples/taosbenchmark-json/sml_telnet.json
TDengine-server-3.0.4.2/examples/taosbenchmark-json/subscribe.json
TDengine-server-3.0.4.2/examples/taosbenchmark-json/tmq.json
TDengine-server-3.0.4.2/driver/
TDengine-server-3.0.4.2/driver/libtaos.so.3.0.4.2
TDengine-server-3.0.4.2/driver/vercomp.txt
TDengine-server-3.0.4.2/driver/libtaosws.so
2) 安装数据库
[root@xsky-node4 soft]# cd TDengine-server-3.0.4.2
[root@xsky-node4 TDengine-server-3.0.4.2]# ./install.sh -e no
Start to update TDengine...
Created symlink from /etc/systemd/system/multi-user.target.wants/taosd.service to /etc/systemd/system/taosd.service.To configure TDengine : edit /etc/taos/taos.cfg
To configure taos Adapter : edit /etc/taos/taosadapter.toml
To start TDengine : sudo systemctl start taosd
To start taos Adapter : sudo systemctl start taosadapter
To access TDengine : use taos -h xsky-node4 in shellTDengine is updated successfully!
Install taoskeeper as a standalone service
taoskeeper is installed, enable it by `systemctl enable taoskeeper`
3)启动数据库
- 启动服务进程:
systemctl start taosd
- 停止服务进程:
systemctl stop taosd
- 重启服务进程:
systemctl restart taosd
- 查看服务状态:
systemctl status taosd
# 使用root用户启动服务
[root@xsky-node4 TDengine-server-3.0.4.2]# systemctl enable taoskeeper
Created symlink from /etc/systemd/system/multi-user.target.wants/taoskeeper.service to /etc/systemd/system/taoskeeper.service.
[root@xsky-node4 TDengine-server-3.0.4.2]#
[root@xsky-node4 TDengine-server-3.0.4.2]# systemctl start taosd
[root@xsky-node4 TDengine-server-3.0.4.2]# systemctl status taosd
● taosd.service - server serviceLoaded: loaded (/etc/systemd/system/taosd.service; enabled; vendor preset: disabled)Active: active (running) since Fri 2023-05-26 13:06:47 CST; 7s agoProcess: 31181 ExecStartPre=/usr/local/taos/bin/startPre.sh (code=exited, status=0/SUCCESS)Main PID: 31188 (taosd)CGroup: /system.slice/taosd.service├─31188 /usr/bin/taosd└─31209 /usr/bin/udfd -c /etc/taos/May 26 13:06:47 xsky-node4 systemd[1]: Starting server service...
May 26 13:06:47 xsky-node4 systemd[1]: Started server service.
[root@xsky-node4 TDengine-server-3.0.4.2]#
[root@xsky-node4 TDengine-server-3.0.4.2]# systemctl start taosadapter
[root@xsky-node4 TDengine-server-3.0.4.2]# systemctl status taosadapter
● taosadapter.service - adapter serviceLoaded: loaded (/etc/systemd/system/taosadapter.service; disabled; vendor preset: disabled)Active: active (running) since Fri 2023-05-26 13:07:02 CST; 6s agoMain PID: 31338 (taosadapter)CGroup: /system.slice/taosadapter.service└─31338 /usr/bin/taosadapterMay 26 13:07:02 xsky-node4 systemd[1]: Started adapter service.
4)使用数据库
TDengine提供了taos这一CLI命令行工具可以方便登录数据库,要登录数据库,执行执行 taos命令即可,登录成功会显示如下信息。
登录数据库后,可使用命令执行创建/删除/查询数据库及表操作。
[root@xsky-node4 TDengine-server-3.0.4.2]# taos
read /etc/localtime error, reason:Invalid argumentThere is not /etc/timezone.
Welcome to the TDengine Command Line Interface, Client Version:3.0.4.2
Copyright (c) 2022 by TDengine, all rights reserved.****************************** Tab Completion *********************************** The TDengine CLI supports tab completion for a variety of items, ** including database names, table names, function names and keywords. ** The full list of shortcut keys is as follows: ** [ TAB ] ...... complete the current word ** ...... if used on a blank line, display all supported commands ** [ Ctrl + A ] ...... move cursor to the st[A]rt of the line ** [ Ctrl + E ] ...... move cursor to the [E]nd of the line ** [ Ctrl + W ] ...... move cursor to the middle of the line ** [ Ctrl + L ] ...... clear the entire screen ** [ Ctrl + K ] ...... clear the screen after the cursor ** [ Ctrl + U ] ...... clear the screen before the cursor ***************************************************************************************Server is Community Edition.taos> # 可以看到和MySQL数据库很像
taos> CREATE DATABASE demo;
Create OK, 0 row(s) affected (0.172574s)taos> USE demo;
Database changed.taos> show databases;name |
=================================information_schema |performance_schema |demo |
Query OK, 3 row(s) in set (0.002513s)taos> CREATE TABLE t (ts TIMESTAMP, speed INT);
Create OK, 0 row(s) affected (0.001873s)taos> INSERT INTO t VALUES ('2023-05-26 13:13:00', 10);
Insert OK, 1 row(s) affected (0.000862s)taos> INSERT INTO t VALUES ('2023-05-26 13:14:00', 20);
Insert OK, 1 row(s) affected (0.000776s)# 时序数据库不能使用commit进行提交
taos> commit;DB error: syntax error near "commit;" (0.000067s)
三、taosBenchmark压测测试
3.1 创建测试数据
可以在当前环境下使用taosBenchmark命令进行压测。
[root@xsky-node4 driver]# taosBenchmark
[05/26 13:16:14.224118] INFO: client version: 3.0.4.2Press enter key to continue or Ctrl-C to stopread /etc/localtime error, reason:Invalid argumentThere is not /etc/timezone.
[05/26 13:16:18.017853] INFO: command to create database: <CREATE DATABASE IF NOT EXISTS test VGROUPS 16 PRECISION 'ms';>
[05/26 13:16:18.022662] SUCC: created database (test)
[05/26 13:16:18.026331] WARN: failed to run command DESCRIBE `test`.`meters`, code: 0x80002603, reason: Table does not exist
[05/26 13:16:18.026372] INFO: stable meters does not exist, will create one
[05/26 13:16:18.026419] INFO: create stable: <CREATE TABLE test.meters (ts TIMESTAMP,current float,voltage int,phase float) TAGS (groupid int,location binary(24))>
[05/26 13:16:18.042256] INFO: generate stable<meters> columns data with lenOfCols<80> * prepared_rand<57>
[05/26 13:16:18.586524] INFO: generate stable<meters> tags data with lenOfTags<62> * childTblCount<10000>
[05/26 13:16:18.590886] INFO: start creating 10000 table(s) with 8 thread(s)
[05/26 13:16:18.592883] INFO: thread[0] start creating table from 0 to 1249
[05/26 13:16:18.593163] INFO: thread[1] start creating table from 1250 to 2499
[05/26 13:16:18.594267] INFO: thread[2] start creating table from 2500 to 3749
[05/26 13:16:18.594675] INFO: thread[3] start creating table from 3750 to 4999
[05/26 13:16:18.595735] INFO: thread[4] start creating table from 5000 to 6249
[05/26 13:16:18.596445] INFO: thread[5] start creating table from 6250 to 7499
[05/26 13:16:18.597336] INFO: thread[6] start creating table from 7500 to 8749
[05/26 13:16:18.597902] INFO: thread[7] start creating table from 8750 to 9999
[05/26 13:16:19.166405] SUCC: Spent 0.5760 seconds to create 10000 table(s) with 8 thread(s), already exist 0 table(s), actual 10000 table(s) pre created, 0 table(s) will be auto createdPress enter key to continue or Ctrl-C to stop # 按回车[05/26 13:16:22.739893] INFO: record per request (30000) is larger than insert rows (10000) in progressive mode, which will be set to 10000
[05/26 13:16:22.829202] INFO: Total 637 tables on bb test's vgroup 0 (id: 4)
[05/26 13:16:22.829223] INFO: Total 630 tables on bb test's vgroup 1 (id: 5)
[05/26 13:16:22.829232] INFO: Total 635 tables on bb test's vgroup 2 (id: 6)
[05/26 13:16:22.829241] INFO: Total 580 tables on bb test's vgroup 3 (id: 7)
[05/26 13:16:22.829249] INFO: Total 588 tables on bb test's vgroup 4 (id: 8)
[05/26 13:16:22.829257] INFO: Total 627 tables on bb test's vgroup 5 (id: 9)
[05/26 13:16:22.829277] INFO: Total 635 tables on bb test's vgroup 6 (id: 10)
[05/26 13:16:22.829290] INFO: Total 672 tables on bb test's vgroup 7 (id: 11)
[05/26 13:16:22.829298] INFO: Total 628 tables on bb test's vgroup 8 (id: 12)
[05/26 13:16:22.829306] INFO: Total 617 tables on bb test's vgroup 9 (id: 13)
[05/26 13:16:22.829321] INFO: Total 615 tables on bb test's vgroup 10 (id: 14)
[05/26 13:16:22.829335] INFO: Total 660 tables on bb test's vgroup 11 (id: 15)
[05/26 13:16:22.829343] INFO: Total 621 tables on bb test's vgroup 12 (id: 16)
[05/26 13:16:22.829357] INFO: Total 610 tables on bb test's vgroup 13 (id: 17)
[05/26 13:16:22.829377] INFO: Total 628 tables on bb test's vgroup 14 (id: 18)
[05/26 13:16:22.829387] INFO: Total 617 tables on bb test's vgroup 15 (id: 19)
[05/26 13:16:22.904732] INFO: Estimate memory usage: 64.46MBPress enter key to continue or Ctrl-C to stop # 按回车[05/26 13:16:51.087453] SUCC: thread[4] progressive mode, completed total inserted rows: 5880000, 252417.64 records/second
[05/26 13:16:51.238672] SUCC: thread[3] progressive mode, completed total inserted rows: 5800000, 246624.54 records/second
[05/26 13:16:52.551139] SUCC: thread[13] progressive mode, completed total inserted rows: 6100000, 247242.48 records/second
[05/26 13:16:52.710359] SUCC: thread[12] progressive mode, completed total inserted rows: 6210000, 250751.84 records/second
[05/26 13:16:52.869708] SUCC: thread[15] progressive mode, completed total inserted rows: 6170000, 247865.38 records/second
[05/26 13:16:52.936221] SUCC: thread[10] progressive mode, completed total inserted rows: 6150000, 246960.57 records/second
[05/26 13:16:52.968699] SUCC: thread[9] progressive mode, completed total inserted rows: 6170000, 247375.94 records/second
[05/26 13:16:52.986824] SUCC: thread[8] progressive mode, completed total inserted rows: 6280000, 252138.93 records/second
[05/26 13:16:53.045996] SUCC: thread[5] progressive mode, completed total inserted rows: 6270000, 251036.01 records/second
[05/26 13:16:53.214220] SUCC: thread[2] progressive mode, completed total inserted rows: 6350000, 252953.29 records/second
[05/26 13:16:53.228965] SUCC: thread[1] progressive mode, completed total inserted rows: 6300000, 249370.62 records/second
[05/26 13:16:53.255729] SUCC: thread[14] progressive mode, completed total inserted rows: 6280000, 249431.25 records/second
[05/26 13:16:53.419322] SUCC: thread[6] progressive mode, completed total inserted rows: 6350000, 250368.38 records/second
[05/26 13:16:53.583290] SUCC: thread[0] progressive mode, completed total inserted rows: 6370000, 249322.08 records/second
[05/26 13:16:53.686440] SUCC: thread[11] progressive mode, completed total inserted rows: 6600000, 258572.71 records/second
[05/26 13:16:54.185829] SUCC: thread[7] progressive mode, completed total inserted rows: 6720000, 257826.77 records/second
[05/26 13:16:54.188303] SUCC: Spent 29.488637 seconds to insert rows: 100000000 with 16 thread(s) into test 3391136.73 records/second
[05/26 13:16:54.188349] SUCC: insert delay, min: 13.9810ms, avg: 39.8915ms, p90: 54.2760ms, p95: 61.5230ms, p99: 73.9060ms, max: 97.9570ms
3.3 查询数据
[root@xsky-node4 TDengine-server-3.0.4.2]# taos
read /etc/localtime error, reason:Invalid argumentThere is not /etc/timezone.
Welcome to the TDengine Command Line Interface, Client Version:3.0.4.2
Copyright (c) 2022 by TDengine, all rights reserved.****************************** Tab Completion *********************************** The TDengine CLI supports tab completion for a variety of items, ** including database names, table names, function names and keywords. ** The full list of shortcut keys is as follows: ** [ TAB ] ...... complete the current word ** ...... if used on a blank line, display all supported commands ** [ Ctrl + A ] ...... move cursor to the st[A]rt of the line ** [ Ctrl + E ] ...... move cursor to the [E]nd of the line ** [ Ctrl + W ] ...... move cursor to the middle of the line ** [ Ctrl + L ] ...... clear the entire screen ** [ Ctrl + K ] ...... clear the screen after the cursor ** [ Ctrl + U ] ...... clear the screen before the cursor ***************************************************************************************Server is Community Edition.taos> show databases;name |
=================================information_schema |performance_schema |demo |test |
Query OK, 4 row(s) in set (0.002425s)taos> use test;
Database changed.# 查询超级表 meters 下的记录总条数, 一亿条,耗时才0.231158s
taos> SELECT COUNT(*) FROM test.meters;count(*) |
========================100000000 |
Query OK, 1 row(s) in set (0.231158s)# 使用聚合函数,查询 1 亿条记录的平均值、最大值、最小值等,也好快
taos> SELECT AVG(current), MAX(voltage), MIN(phase) FROM test.meters;avg(current) | max(voltage) | min(phase) |
==================================================================9.979949643 | 114 | 0.29167 |
Query OK, 1 row(s) in set (0.417387s)# 从一亿条数据查询 location = "California.SanFrancisco" 的记录总条数:
taos> SELECT COUNT(*) FROM test.meters WHERE location = "California.SanFrancisco";count(*) |
========================10130000 |
Query OK, 1 row(s) in set (0.051128s)# 查询 groupId = 10 的所有记录的平均值、最大值、最小值等:
taos> SELECT AVG(current), MAX(voltage), MIN(phase) FROM test.meters WHERE groupId = 10;avg(current) | max(voltage) | min(phase) |
==================================================================9.979666885 | 114 | 0.29167 |
Query OK, 1 row(s) in set (0.092011s)# 对表 d10 按 10 每秒进行平均值、最大值和最小值聚合统计:
taos> SELECT FIRST(ts), AVG(current), MAX(voltage), MIN(phase) FROM test.d10 INTERVAL(10s);first(ts) | avg(current) | max(voltage) | min(phase) |
============================================================================================2017-07-14 10:40:00.000 | 9.990264009 | 114 | 0.29167 |
Query OK, 1 row(s) in set (0.004499s)
四、后记
目前万里长征人刚迈出数据库安装和简单使用的一步,之前测试和使用过众多国产分布式数据库,本次算是和国产时序数据库的第一次亲密接触,后面将逐步深入去了解这块数据库,也希望后面的一些项目、尤其是监控项目能使用到,先给自己加个油!
后面也想尝试下采用集群部署TDengine,看看集群下的国产时序数据库是什么样子,待后面会将这部分内容分享到墨天轮。