执行cpp-driver datastax时出现协议错误
Protocol error when executing cpp-driver datastax
我目前正在使用 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.
任何有解决方法或解决方案的人都会有很大帮助。提前致谢
我四处寻找一些文档来支持这一点,但我找不到任何文档,所以这部分是推测。看起来服务器版本 3 使用协议 V3。看起来服务器版本 4(仍处于测试阶段)将使用协议 V4。我怀疑 V5 是未来的迭代,正在计划中,但仍未确定(以及为什么在警告中将其标记为 beta)。
这部分不是猜想。
如果您在连接到集群之前将此添加到您的代码中:
cass_cluster_set_protocol_version(cluster, CASS_PROTOCOL_VERSION_V3);
所有关于降级到不同协议的警告都应该消失。
我目前正在使用 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.
任何有解决方法或解决方案的人都会有很大帮助。提前致谢
我四处寻找一些文档来支持这一点,但我找不到任何文档,所以这部分是推测。看起来服务器版本 3 使用协议 V3。看起来服务器版本 4(仍处于测试阶段)将使用协议 V4。我怀疑 V5 是未来的迭代,正在计划中,但仍未确定(以及为什么在警告中将其标记为 beta)。
这部分不是猜想。 如果您在连接到集群之前将此添加到您的代码中:
cass_cluster_set_protocol_version(cluster, CASS_PROTOCOL_VERSION_V3);
所有关于降级到不同协议的警告都应该消失。