Cassandra数据库未通过Rcassandra与R连接 [英] Cassandra Database is not connecting with R via Rcassandra

查看:47
本文介绍了Cassandra数据库未通过Rcassandra与R连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用RCassandra软件包连接到Cassandra数据库时,正在建立连接。但是当尝试使用任何键空间时,R没有响应。我使用了以下语句。

When I'm connecting to Cassandra database using RCassandra package, connection is establishing. But When trying to use any keyspace, R is not responding.I used the following statements.


library(RCassandra)

library(RCassandra)

rc<-RC.connect(主机=本地主机,端口= 9042)

rc <- RC.connect(host ="localhost", port = 9042)

RC.use(rc, db1,cache.def = TRUE)

RC.use(rc, "db1", cache.def = TRUE)

任何建议请

推荐答案

您的问题是您直接指定端口,并且使用的是本机协议的端口,而RCassandra使用节俭协议(使用端口9160),因此,当它与9042端口通信时,根本不理解其含义。因此,您需要完全删除 port 参数,或将其指定为 9160 ,并确保您具有<$在 cassandra.yaml 中将c $ c> start_rpc 参数设置为 true

Your problem is that you're specifying the port directly, and you're using the port of the native protocol, while RCassandra uses thrift protocol (that uses port 9160), so when it's talking to port 9042, it simply don't understand what it says. So you need to either remove port argument completely, or specify it as 9160, and make sure that you have start_rpc parameter set to true in the cassandra.yaml.

我研究了RCassandra的源代码,发现它没有更新超过5年。并且由于它使用Thrift而不是本机协议,因此与使用本机协议相比,您有很多限制。在下一个主要版本的Cassandra-4.0中将删除对Thrift的支持。更好的选择是编写一个围绕DataStax C / C ++驱动程序的包装,并将底层功能公开给R。

I've looked into source code of the RCassandra, and see that it wasn't updated for more than 5 years. And as it uses Thrift instead of native protocol, then you have many limitations comparing to use of native protocol. And support for Thrift will be removed in the next major version of Cassandra - 4.0. The better alternative will be to write a wrapper around DataStax C/C++ driver, and expose underlying functionality to R.

这篇关于Cassandra数据库未通过Rcassandra与R连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆