c-执行cpp驱动程序数据税时出现协议错误



我目前正在研究C中的datastax-cpp驱动程序,当我遇到一个非常琐碎的问题时,我正在处理一些例子。在尝试执行这里的基本身份验证脚本时,我发现出现了此错误,代码执行陷入停滞。

错误:

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驱动程序2.13。

任何有变通办法或解决方案的人都会有很大帮助。提前感谢

我找了很多文档来支持这一点,但找不到任何文档,所以这部分只是猜测。服务器版本3似乎使用了协议V3。看起来服务器版本4(仍处于测试版(将使用协议V4。我怀疑V5是一个正在计划中的未来迭代,但还没有用石头写出来(以及为什么它在警告中被标记为测试版(。

这部分不是猜测。如果在连接到集群之前将其添加到代码中:

cass_cluster_set_protocol_version(cluster, CASS_PROTOCOL_VERSION_V3);

所有关于降级到不同协议的警告都应该消失。

相关内容