- 准备好接收时序数据库的邮箱 ``` https://exmail.qq.com/login darren@ddingsafe.com TecheDing2019 ``` - 安装时序数据库 ``` --登录网址:https://www.taosdata.com/cn/getting-started/ --下载deb包 --确认安装位置:/home/dingding/下载/ --在下载位置打开命令行终端 --开始安装:sudo dpkg -i TDengine-server-2.0.13.0-Linux-x64.deb --检查状态:sudo systemctl status taosd --启动:sudo systemctl start taosd ``` - 来到配置文件,查看配置:etc/taos/taos.cfg ``` 时序数据库API地址:http://127.0.0.1:6020/rest/sql 时序数据库用户名:root 时序数据库密码:taosdata 时序数据库名称:rlq_jiaozhou_10_12(集团编号_项目编号) ``` - 小试 ``` create database db; show databases; use db; create table t(ts timestamp, cdata int); insert into t values ('2019-07-15 00:00:00'); select * from t; ``` - 应用程序配置连接字符串 ``` "cloudgo": "0", //云端关系数据库是否开通 "shixugo": "1", //云端时序数据库是否开通 "groupid": "10", //集团编号 "projectid": "12", //集团项目编号 "TDegnine": { "DataSource": "http://127.0.0.1:6041/rest/sql", "Username": "root", "Password": "taosdata", "Database": "rlq_jiaozhou_10_12", "PlanInterval": 5000, "CDataSource": "http://47.102.145.164:6020/rest/sql", "CUsername": "root", "CPassword": "taosdata", "CDatabase": "rlq_huaian_7_10" }, ``` - 局域网时序数据库的原理 ``` --RealDataToTDengine,每5分钟运行一次 --时序数据库 --时序超级表 --时序子表 ``` - 修改RealDataToTDengine,只支持本地数据库 - 修改批量创建子表:ShiXuChild - 修改创建超级表:SuperTable - 开始实施 ``` --更新程序 --更新设置,除了shixugo之外的先更新 "cloudgo": "0", //云端关系数据库是否开通 "shixugo": "0", //云端时序数据库是否开通 "groupid": "10", //集团编号 "projectid": "12", //集团项目编号 "TDegnine": { "DataSource": "http://127.0.0.1:6041/rest/sql", "Username": "root", "Password": "taosdata", "Database": "rlq_jiaozhou_10_12", "PlanInterval": 5000, "CDataSource": "http://47.102.145.164:6020/rest/sql", "CUsername": "root", "CPassword": "taosdata", "CDatabase": "rlq_huaian_7_10" }, -- 启动程序:dotnet DD.Local.Web.dll -- 创建数据库:create database rlq_jiaozhou_10_12 KEEP 365; -- 创建超级表 -- 确定超级表是否存在:show stables; -- 创建所有SuperReal的子表 -- 确认子表是否创建:describe real_187ed532492c; -- 开启本地时序 "cloudgo": "0", //云端关系数据库是否开通 "shixugo": "1", //云端时序数据库是否开通 -- 开启程序 -- 验证是否成功 日志:上传实时时序数据第{i} 187ED532492C,187ED5329AEC,187ED53218F4,187ED53297F0,187ED53298B0,187ED5328B40,187ED5329A0C,187ED53287F8,187ED5324FAC,187ED5329C44上传实时时序数据第0次成功 select * from real_187ed532492c where ts > now - 1d; select * from real_187ed5329aec where ts > now - 1d; select * from real_187ed53218f4 where ts > now - 1d; select * from real_187ed53297f0 where ts > now - 1d; select * from real_187ed53298b0 where ts > now - 1d; select * from real_187ed5328b40 where ts > now - 1d; select * from real_187ed5329a0c where ts > now - 1d; select * from real_187ed53287f8 where ts > now - 1d; select * from real_187ed5324fac where ts > now - 1d; select * from real_187ed5329c44 where ts > now - 1d; ```