Reputation:
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)
rc <- RC.connect(host ="localhost", port = 9042)
RC.use(rc, "db1", cache.def = TRUE)
Any sugestions Please
Upvotes: 1
Views: 174
Reputation: 87279
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
.
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.
Upvotes: 1