作者:loto1115丨 | 来源:互联网 | 2023-07-29 22:37
TDengine:远程连接taosd服务之-windows客户端和JDBC-JNI
Widnows客户端
下载与服务器端版本一致的客户端
下载地址:https://www.taosdata.com/all-downloads

安装完成之后在C盘会出现一个目录:C:\TDengine

然后在这个目录下进入命令行

TDengine
默认使用6030端口通信,所以在服务器端需要开放6030的TCP端口
JDBC-JNI
官方demo:https://github.com/taosdata/TDengine/tree/develop/tests/examples/JDBC
这些示例在安装的客户端目录也有: /usr/local/taos/examples/JDBC
或者 C:\TDengine\examples\JDBC
开放端口
JDBC-JNI
使用的是 com.taosdata.jdbc. TSDBDriver
,连接 6030
端口,所以也需要开放TCP、UDP
iptables -I INPUT -p TCP --dport 6030 -j ACCEPT
iptables -I INPUT -p UDP --dport 6030 -j ACCEPT
依赖对应

com.taosdata.jdbc
taos-jdbcdriver
2.0.34
修改hosts文件
TDengine采用FQDN
(一般就是hostname)作为节点的ID,为保证正常运行,需要给运行taosd的服务器配置好hostname
, 在客户端应用运行的机器配置好DNS服务或hosts文件,保证FQDN能够解析。
因此我们需要在本机的host添加
windows在 C:\Windows\System32\drivers\etc
目录下有个hosts
在里面添加一行
宿主机ip 容器id(即TDengine内执行hostname的返回值

例如:
192.168.31.100 myTDengine
java代码里面执行成功
