TDengine–物联网大数据平台初使用(一:安装)

涛思数据的TDengine是创始人陶建辉(Jefft)带领团队开发的物联网大数据平台,据官方https://www.taosdata.com/cn/ 描述不难看出圈内又一大国神器横空出世;恰巧作为一个多年来被动碾转各个技术领域战场的老兵又有了一次亲近物联网项目的契机,看到TDengine,不禁老夫聊发少年狂,技痒难耐,走,粗发:

1. TDengine只支持在使用systemd做进程服务管理的linux系统上安装。

刚从阿里云上申请了台ECS, centos7。

# which systemd

不支持systemd命令;只能源码安装了。

2. 下载源码

进入 https://github.com/taosdata/TDengine 下载源码

3. 安装编译环境

# yum install -y gcc gcc-c++ make automake
# yum -y install cmake

4. 安装java

文档上说:To compile and package the JDBC driver source code, you should have a Java jdk-8 or higher and Apache Maven 2.7 or higher installed. To install openjdk-8 on Ubuntu;

我不用java,但是…我们不得不悲哀的发现:大多数时候,我们不得不向这个世界低头

#yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel

再安装 maven
#wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo

*–2019-08-30 12:40:23– http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo
正在解析主机 repos.fedorapeople.org (repos.fedorapeople.org)… 152.19.134.199, 2610:28:3090:3001:5054:ff:fea7:9474
正在连接 repos.fedorapeople.org (repos.fedorapeople.org)|152.19.134.199|:80… 已连接。
已发出 HTTP 请求,正在等待回应… 302 Found
位置:https://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo [跟随至新的 URL]
–2019-08-30 12:40:24– https://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo
正在连接 repos.fedorapeople.org (repos.fedorapeople.org)|152.19.134.199|:443… 已连接。
已发出 HTTP 请求,正在等待回应… 200 OK
长度:445
正在保存至: “/etc/yum.repos.d/epel-apache-maven.repo”

100%[============================================================================================================>] 445 –.-K/s 用时 0s

2019-08-30 12:40:26 (23.0 MB/s) – 已保存 “/etc/yum.repos.d/epel-apache-maven.repo” [445/445])**

yum -y install apache-maven

安装完毕查看是否ok:
# mvn -v
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T15:58:13+08:00)
Maven home: /usr/share/apache-maven
Java version: 1.8.0222, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el76.x8664/jre
Default locale: zhCN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-957.21.3.el7.x8664", arch: "amd64", family: "unix"

5.编译安装TDengine

进入刚才下载的源码根目录
# cd TDengine-master
建立build目录:
TDengine-master]# mkdir build && cd build

编译:
#cmake .. && cmake --build .

等待编译完毕
在 TDengine-master/build 目录中,又发现一个build目录
build]# ll
总用量 64
drwxr-xr-x 4 root root 4096 8月 30 13:00 build
-rw-r–r– 1 root root 14809 8月 30 13:00 CMakeCache.txt
drwxr-xr-x 4 root root 4096 8月 30 13:09 CMakeFiles
-rw-r–r– 1 root root 2690 8月 30 13:00 cmakeinstall.cmake
-rw-r–r– 1 root root 2824 8月 30 13:00 CPackConfig.cmake
-rw-r–r– 1 root root 3220 8月 30 13:00 CPackSourceConfig.cmake
drwxr-xr-x 7 root root 4096 8月 30 13:00 deps
-rw-r–r– 1 root root 0 8月 30 13:09 installmanifest.txt
-rw-r–r– 1 root root 12486 8月 30 13:00 Makefile
drwxr-xr-x 12 root root 4096 8月 30 13:00 src
drwxr-xr-x 5 root root 4096 8月 30 13:00 test

继续待在当前目录,安装
build]# make install

6.启动服务

# taosd

*08/30 13:14:47.825160 7f811dfc2740 UTL timezone not configured, set to system default:Asia/Shanghai (CST, +0800)
08/30 13:14:47.825242 7f811dfc2740 UTL locale not configured, set to system default:zhCN.UTF-8
08/30 13:14:47.825257 7f811dfc2740 UTL charset not configured, set to system default:UTF-8
08/30 13:14:47.825384 7f811dfc2740 UTL taos config & system info:
08/30 13:14:47.825394 7f811dfc2740 UTL ==================================
08/30 13:14:47.825398 7f811dfc2740 UTL internalIp: x.x.x.x
08/30 13:14:47.825402 7f811dfc2740 UTL serverIp: 0.0.0.0
08/30 13:14:47.825405 7f811dfc2740 UTL localIp: 0.0.0.0
08/30 13:14:47.825409 7f811dfc2740 UTL httpIp: 0.0.0.0
08/30 13:14:47.825419 7f811dfc2740 UTL httpPort: 6020
08/30 13:14:47.825423 7f811dfc2740 UTL mgmtShellPort: 6030
08/30 13:14:47.825426 7f811dfc2740 UTL vnodeShellPort: 6035
08/30 13:14:47.825431 7f811dfc2740 UTL configDir: /etc/taos
08/30 13:14:47.825439 7f811dfc2740 UTL dataDir: /var/lib/taos
08/30 13:14:47.825443 7f811dfc2740 UTL logDir: /var/log/taos
08/30 13:14:47.825446 7f811dfc2740 UTL scriptDir: /etc/taos
08/30 13:14:47.825449 7f811dfc2740 UTL numOfThreadsPerCore: 1.000000
08/30 13:14:47.825468 7f811dfc2740 UTL ratioOfQueryThreads: 0.500000
08/30 13:14:47.825473 7f811dfc2740 UTL numOfVnodesPerCore: 8
08/30 13:14:47.825476 7f811dfc2740 UTL numOfTotalVnodes: 0
08/30 13:14:47.825480 7f811dfc2740 UTL tables: 1000
08/30 13:14:47.825490 7f811dfc2740 UTL cache: 16384(byte)
08/30 13:14:47.825493 7f811dfc2740 UTL rows: 4096
08/30 13:14:47.825496 7f811dfc2740 UTL fileBlockMinPercent: 0.050000
08/30 13:14:47.825501 7f811dfc2740 UTL ablocks: 4
08/30 13:14:47.825511 7f811dfc2740 UTL tblocks: 100
08/30 13:14:47.825514 7f811dfc2740 UTL monitorInterval: 30(s)
08/30 13:14:47.825518 7f811dfc2740 UTL rpcTimer: 300(ms)
08/30 13:14:47.825521 7f811dfc2740 UTL rpcMaxTime: 600(s)
08/30 13:14:47.825525 7f811dfc2740 UTL ctime: 3600(s)
08/30 13:14:47.825529 7f811dfc2740 UTL statusInterval: 1(s)
08/30 13:14:47.825546 7f811dfc2740 UTL shellActivityTimer: 3(s)
08/30 13:14:47.825550 7f811dfc2740 UTL meterMetaKeepTimer: 7200(s)
08/30 13:14:47.825553 7f811dfc2740 UTL metricMetaKeepTimer: 600(s)
08/30 13:14:47.825565 7f811dfc2740 UTL maxUsers: 1000
08/30 13:14:47.825568 7f811dfc2740 UTL maxDbs: 1000
08/30 13:14:47.825572 7f811dfc2740 UTL maxTables: 650000
08/30 13:14:47.825575 7f811dfc2740 UTL maxVGroups: 1000
08/30 13:14:47.825578 7f811dfc2740 UTL minSlidingTime: 10(ms)
08/30 13:14:47.825587 7f811dfc2740 UTL minIntervalTime: 10(ms)
08/30 13:14:47.825590 7f811dfc2740 UTL maxStreamCompDelay: 20000(ms)
08/30 13:14:47.825594 7f811dfc2740 UTL maxFirstStreamCompDelay:10000(ms)
08/30 13:14:47.825617 7f811dfc2740 UTL retryStreamCompDelay: 10(ms)
08/30 13:14:47.825621 7f811dfc2740 UTL clog: 1
08/30 13:14:47.825624 7f811dfc2740 UTL comp: 2
08/30 13:14:47.825628 7f811dfc2740 UTL days: 10
08/30 13:14:47.825631 7f811dfc2740 UTL keep: 3650
08/30 13:14:47.825634 7f811dfc2740 UTL defaultDB:
08/30 13:14:47.825638 7f811dfc2740 UTL defaultUser: root
08/30 13:14:47.825641 7f811dfc2740 UTL timezone: Asia/Shanghai (CST, +0800)
08/30 13:14:47.825645 7f811dfc2740 UTL locale: zhCN.UTF-8
08/30 13:14:47.825648 7f811dfc2740 UTL charset: UTF-8
08/30 13:14:47.825651 7f811dfc2740 UTL maxShellConns: 2000
08/30 13:14:47.825654 7f811dfc2740 UTL maxMeterConnections: 10000
08/30 13:14:47.825658 7f811dfc2740 UTL maxMgmtConnections: 2000
08/30 13:14:47.825661 7f811dfc2740 UTL maxVnodeConnections: 10000
08/30 13:14:47.825663 7f811dfc2740 UTL minimalLogDirGB: 0.100000(GB)
08/30 13:14:47.825667 7f811dfc2740 UTL minimalTmpDirGB: 0.100000(GB)
08/30 13:14:47.825671 7f811dfc2740 UTL minimalDataDirGB: 0.500000(GB)
08/30 13:14:47.825674 7f811dfc2740 UTL enableHttp: 1
08/30 13:14:47.825678 7f811dfc2740 UTL enableMonitor: 1
08/30 13:14:47.825683 7f811dfc2740 UTL httpCacheSessions: 100
08/30 13:14:47.825686 7f811dfc2740 UTL telegrafUseFieldNum: 0
08/30 13:14:47.825698 7f811dfc2740 UTL httpMaxThreads: 2
08/30 13:14:47.825701 7f811dfc2740 UTL httpEnableCompress: 0
08/30 13:14:47.825705 7f811dfc2740 UTL numOfLogLines: 10000000
08/30 13:14:47.825708 7f811dfc2740 UTL asyncLog: 1
08/30 13:14:47.825733 7f811dfc2740 UTL debugFlag: 131
08/30 13:14:47.825739 7f811dfc2740 UTL mDebugFlag: 135
08/30 13:14:47.825743 7f811dfc2740 UTL dDebugFlag: 131
08/30 13:14:47.825746 7f811dfc2740 UTL sdbDebugFlag: 135
08/30 13:14:47.825749 7f811dfc2740 UTL taosDebugFlag: 131
08/30 13:14:47.825755 7f811dfc2740 UTL tmrDebugFlag: 131
08/30 13:14:47.825758 7f811dfc2740 UTL cDebugFlag: 131
08/30 13:14:47.825761 7f811dfc2740 UTL jniDebugFlag: 131
08/30 13:14:47.825765 7f811dfc2740 UTL odbcDebugFlag: 131
08/30 13:14:47.825768 7f811dfc2740 UTL uDebugFlag: 131
08/30 13:14:47.825772 7f811dfc2740 UTL httpDebugFlag: 131
08/30 13:14:47.825775 7f811dfc2740 UTL monitorDebugFlag: 131
08/30 13:14:47.825778 7f811dfc2740 UTL qDebugFlag: 131
08/30 13:14:47.825782 7f811dfc2740 UTL gitinfo: 44f8a3d73d839b2b840b9c80243ec0edf0f5d5ab
08/30 13:14:47.825786 7f811dfc2740 UTL buildinfo: Built by slguan at 2019-08-22 16:51
08/30 13:14:47.825790 7f811dfc2740 UTL version: 1.6.1.7
08/30 13:14:47.825793 7f811dfc2740 UTL dataDir: /var/lib/taos
08/30 13:14:47.825796 7f811dfc2740 UTL os pageSize: 4096(KB)
08/30 13:14:47.825799 7f811dfc2740 UTL os openMax: 65535
08/30 13:14:47.825802 7f811dfc2740 UTL os streamMax: 16
08/30 13:14:47.825805 7f811dfc2740 UTL os numOfCores: 2
08/30 13:14:47.825807 7f811dfc2740 UTL os totalDisk: 39.241287(GB)
08/30 13:14:47.825834 7f811dfc2740 UTL os totalMemory: 3789(MB)
08/30 13:14:47.825841 7f811dfc2740 UTL os sysname: Linux
08/30 13:14:47.825846 7f811dfc2740 UTL os nodename: iZ2ze0r55hupn3qtcbcu8tZ
08/30 13:14:47.825849 7f811dfc2740 UTL os release: 3.10.0-957.21.3.el7.x8664
08/30 13:14:47.825852 7f811dfc2740 UTL os version: #1 SMP Tue Jun 18 16:35:19 UTC 2019
08/30 13:14:47.825855 7f811dfc2740 UTL os machine: x8664
08/30 13:14:47.825858 7f811dfc2740 UTL ==================================
08/30 13:14:47.825860 7f811dfc2740 DND Server IP address is:x.x.x.x
08/30 13:14:47.825865 7f811dfc2740 DND starting to initialize TDengine engine …
08/30 13:14:47.833362 7f811dfc2740 DND vnode is initialized successfully
08/30 13:14:47.833391 7f811dfc2740 MND starting to initialize TDengine mgmt …
08/30 13:14:47.834266 7f811dfc2740 MND first access, set total vnodes:50
08/30 13:14:47.845908 7f811dfc2740 MND TDengine mgmt is initialized successfully
08/30 13:14:47.845921 7f811dfc2740 HTP starting to initialize http service …
08/30 13:14:47.846133 7f811dfc2740 DND TDengine is initialized successfully
08/30 13:14:47.846152 7f81077b6700 HTP http service init success at ip:0.0.0.0:6020
08/30 13:14:48.032070 7f8114d8b700 MON starting to initialize monitor service ..
08/30 13:14:48.032472 7f810bf01700 MND user:monitor login from 127.0.0.1, code:0
08/30 13:14:48.032822 7f810b700700 MND DB:0.log is created by monitor
08/30 13:14:48.082469 7f811658e700 MON dnode:x.x.x.x is started
08/30 13:14:48.084113 7f811658e700 MON monitor service init success*

7.启动客户端

服务启动成功,用另外一个终端去连接服务
# taos

*Welcome to the TDengine shell, client version:1.6.1.7 server version:1.6.1.7
Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.

taos> *

好了,centos7上到此安装完毕。

原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/197147.html

(0)
上一篇 2021年11月17日
下一篇 2021年11月17日

相关推荐

发表回复

登录后才能评论