taosdata / TDengine

High-performance, scalable time-series database designed for Industrial IoT (IIoT) scenarios
https://tdengine.com
GNU Affero General Public License v3.0
23.33k stars 4.85k forks source link

window to linux Unable to establish connection #3221

Closed t1567954 closed 4 years ago

t1567954 commented 4 years ago

我把代码发到服务器上跑是成功的,但是我想本地调试好像不行 host 加入了服务器ip 及域名 代码配置为 datasource: driver-class-name: com.taosdata.jdbc.TSDBDriver url: jdbc:TAOS://192.168.0.7:6030/log data-username: data-password: 这里的时候尝试用过域名,这里具体配置能告知吗? 报错为

Error updating database. Cause: java.sql.SQLException: TDengine Error: Unable to establish connection

The error may exist in file [E:\transferMicroservices\server-mqtt-client\target\classes\mapper\WeatherMapper.xml]

The error may involve com.deepcam.servermqttclient.mapper.WeatherMapper.insert-Inline

The error occurred while setting parameters

SQL: insert into test.weather (ts, temperature, humidity) values (now, ?, ?)

Cause: java.sql.SQLException: TDengine Error: Unable to establish connection

; uncategorized SQLException; SQL state []; error code [-2147483637]; TDengine Error: Unable to establish connection; nested exception is java.sql.SQLException: TDengine Error: Unable to establish connection] with root cause java.sql.SQLException: TDengine Error: Unable to establish connection 本机记录 log为 08/25 14:26:10.600000 0x00003d2c RPC ERROR TSC 0000000024D35E80 000000000136CB70, failed to send, msgLen:96 written:-1, reason:Invalid argument

x1234521 commented 4 years ago

如果是用docker的话,试试把服务端口6030-6041/udp放开。

t1567954 commented 4 years ago

如果是用docker的话,试试把服务端口6030-6041/udp放开。

服务器没有用docker,用的安装包,代码发到服务器是可以使用的。

zhangzl0119 commented 4 years ago

我也遇到同样的问题,windows连linux服务器

x1234521 commented 4 years ago

考虑下防火墙。 你的这个提示,是表示连接不到对方的IP+端口,,涛思的客户端默认采用UDP协议连接,所以仔细确定下。

t1567954 commented 4 years ago

考虑下防火墙。 你的这个提示,是表示连接不到对方的IP+端口,,涛思的客户端默认采用UDP协议连接,所以仔细确定下。

我本机是可以ping通服务器的,而且我查了防火墙应该没问题。

zhangzl0119 commented 4 years ago

防火墙都是没开的,udp端口也是没问题的

ljw0903 commented 4 years ago

同样的问题 服务器的log也没有日志显示 udp和tcp的端口都开的

ljw0903 commented 4 years ago

https://github.com/taosdata/TDengine/issues/3250#issuecomment-681323144 我用这个解决了 你可以试一下