【发布时间】:2020-07-29 17:09:55
【问题描述】:
我目前正在研究 C 中的 datastax cpp-driver,并且在遇到一个非常微不足道的问题时正在解决一些示例。在尝试在这里执行Basic Authentication Script 时,我发现此错误出现并且代码执行卡住了。
错误:
1587040775.210 [ERROR] (cluster_connector.cpp:192:void datastax::internal::core::ClusterConnector::on_connect(datastax::internal::core::ControlConnector*)): Unable to establish a control connection to host 127.0.0.3 because of the following error: Underlying connection error: Connect error 'connection refused'
1587040775.210 [ERROR] (cluster_connector.cpp:192:void datastax::internal::core::ClusterConnector::on_connect(datastax::internal::core::ControlConnector*)): Unable to establish a control connection to host 127.0.0.2 because of the following error: Underlying connection error: Connect error 'connection refused'
1587040775.211 [ERROR] (cluster_connector.cpp:192:void datastax::internal::core::ClusterConnector::on_connect(datastax::internal::core::ControlConnector*)): Unable to establish a control connection to host 127.0.0.1 because of the following error: Underlying connection error: Received error response 'Invalid or unsupported protocol version (66); supported versions are (3/v3, 4/v4, 5/v5-beta)' (0x0200000A)
1587040775.211 [WARN] (cluster_connector.cpp:289:void datastax::internal::core::ClusterConnector::on_connect(datastax::internal::core::ControlConnector*)): Host 127.0.0.1 does not support protocol version DSEv2. Trying protocol version DSEv1...
1587040775.212 [ERROR] (cluster_connector.cpp:192:void datastax::internal::core::ClusterConnector::on_connect(datastax::internal::core::ControlConnector*)): Unable to establish a control connection to host 127.0.0.1 because of the following error: Underlying connection error: Received error response 'Invalid or unsupported protocol version (65); supported versions are (3/v3, 4/v4, 5/v5-beta)' (0x0200000A)
1587040775.212 [WARN] (cluster_connector.cpp:289:void datastax::internal::core::ClusterConnector::on_connect(datastax::internal::core::ControlConnector*)): Host 127.0.0.1 does not support protocol version DSEv1. Trying protocol version v4...
我的机器不支持哪些协议?此外,在到达最后一个警告trying protocol v4 之后,它就会卡住。
我正在使用 Casssandra 3.10+,Cpp-driver 2.13。
任何有解决方法或解决方案的人都会有很大帮助。提前致谢
【问题讨论】:
-
错误消息似乎足够冗长和连续(
Unable to establish a control connection to host 127.0.0.3 because of the following error: Underlying connection error: Connect error 'connection refused'字面解释是您无法连接。确保您引用了正确的地址,并传递了正确的凭据,并有足够的权限获得连接。 -
@ryyker 好的,所以看起来我们在这里有点不确定。我已经提供了所用脚本的链接。如您所见,它已经在使用 localhost 进行连接。这正是我正在做的。此外,凭据是正确的,一切都是正确的。我猜你没有阅读整个错误。后来它说这里有一个不受支持的协议问题。到没有拒绝连接又名
127.0.0.1的主机。如果连接被拒绝是我的问题,我就不会在标题中写一个微不足道的错误和协议错误,先生。