过程描述

  1. 首先配置数据库连接信息

  1. 下载驱动jar包,配置驱动

Maven Repository: com.taosdata.jdbc » taos-jdbcdriver (mvnrepository.com)

  1. 下载 TDengine-Client 安装程序(无脑下一步即可)

使用安装包立即开始 | TDengine 文档 | 涛思数据 (taosdata.com)

所有下载链接 - TDengine | 涛思数据 (taosdata.com)

注意:高版本的 TDengine 已经分为了 Server 和 Client 两端,两个都需要下载才能好用;如果是低版本的,下载 Client 端即可,本次下载的是 TDengine-client-2.4.0.16-Windows-x64;否则可能会出现 commitCallbackError.

问题描述

完成以上步骤后,IDEA 里面就显示数据库连接成功了,但是我想查看表数据时,出现了一个错误提示

解决问题

首先在C:\Windows\System32\drivers\etc 文件夹下的 hosts 文件中配置 TDengine 服务。

192.168.x.xx tdengine1

配置好后,可以在 CMD 里面执行【ping tengine1】,验证是否配置成功。

然后在 C:\TDengine\cfg 文件夹下,追加一个 taosadapter.toml 文件。

内容如下:

debug = false
taosConfigDir = ""
port = 6041
logLevel = "info"

[cors]
allowAllOrigins = true

[pool]
maxConnect = 4000
maxIdle = 4000
idleTimeout = "1h"

[ssl]
enable = false
certFile = ""
keyFile = ""

[log]
#path = "/var/log/taos"
rotationCount = 30
rotationTime = "24h"
rotationSize = "1GB"
enableRecordHttpSql = false
sqlRotationCount = 2
sqlRotationTime =  "24h"
sqlRotationSize = "1GB"

[monitor]
collectDuration = "3s"
incgroup = false
pauseQueryMemoryThreshold = 70
pauseAllMemoryThreshold = 80
identity = ""
writeToTD = false
user = "root"
password = "taosdata"
writeInterval = "30s"

[opentsdb]
enable = true

[influxdb]
enable = true

[statsd]
enable = true
port = 6044
db = "statsd"
user = "root"
password = "taosdata"
worker = 10
gatherInterval = "5s"
protocol = "udp"
maxTCPConnections = 250
tcpKeepAlive = false
allowPendingMessages = 50000
deleteCounters = true
deleteGauges = true
deleteSets = true
deleteTimings = true

[collectd]
enable = false
port = 6045
db = "collectd"
user = "root"
password = "taosdata"
worker = 10


[opentsdb_telnet]
enable = false
maxTCPConnections = 250
tcpKeepAlive = false
dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"]
ports = [6046, 6047, 6048, 6049]
user = "root"
password = "taosdata"
batchSize = 1
flushInterval = "0s"

[node_exporter]
enable = false
db = "node_exporter"
user = "root"
password = "taosdata"
urls = ["http://localhost:9100"]
responseTimeout = "5s"
httpUsername = ""
httpPassword = ""
httpBearerTokenString = ""
caCertFile = ""
certFile = ""
keyFile = ""
insecureSkipVerify = true
gatherDuration = "5s"

[prometheus]
enable = true

完成这波操作后,便成功的在 IDEA 中连接上了 TDengine 数据库。(如果无效,可以重启一下 IDEA 试试)

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐