2

The Spark-Cassandra connector references that I went through use 127.0.0.1, so wondering if it is possible for Spark to connect to Cassandra node hosted in different servers.

a. If possible, are there any extra steps needed to make the connection, than hosted in the same physical server

b. If it is not possible, how else I could connect Spark with Cassandra.

Saravanan
  • 127
  • 1
  • 1
  • 7
  • It might help if you provided a few more details. For example, is https://github.com/datastax/spark-cassandra-connector the connector you are using? What documentation or tutorials have you already tried (provide links)? – nonesuchnick Nov 05 '15 at 22:44
  • Also, make sure to search other answers thoroughly. This answer http://stackoverflow.com/a/25945032/1100827 seems to show that you can connect to any Cassandra machine by IP. – nonesuchnick Nov 05 '15 at 23:03
  • Yes, your link is correct. I'm using the same connector by DataStax. Some tutorials ([link](https://github.com/datastax/spark-cassandra-connector/blob/master/doc/0_quick_start.md), [link](http://www.datastax.com/dev/blog/accessing-cassandra-from-spark-in-java)) I tried which always uses localhost. – Saravanan Nov 05 '15 at 23:03
  • Thanks. Yes, I will do more digging next time. – Saravanan Nov 06 '15 at 00:32

1 Answers1

3

Yes it is able to connect to different clusters. Even different clusters at the same time. If you just want to connect to a single different cluster just use the spark.cassandra.connection.host parameter.

https://github.com/datastax/spark-cassandra-connector/blob/master/doc/1_connecting.md

RussS
  • 16,476
  • 1
  • 34
  • 62