0

I'm just getting started with Cassandra and had a few questions. I'm going to be deploying a 4 node cluster on AWS as per the DataStax documentation (http://www.datastax.com/docs/datastax_enterprise3.1/install/install_dse_ami).

Once I have this 4 node cluster up and running, i'll be creating a simple LAMP server which will (hopefully) do the querying to the cluster. I'll be using Cassandra-PDO for the communication (http://code.google.com/a/apache-extras.org/p/cassandra-pdo/). This totals 5 servers in the end.

For example:

192.168.0.1 - Cassandra1
192.168.0.2 - Cassandra2
192.168.0.3 - Cassandra3
192.168.0.4 - Cassandra4
192.168.0.5 - LAMP Stack

How do I balance all my requests from the LAMP server to my Cassandra cluster? In the CPDO example, they mention the following:

$dsn = "cassandra:host=192.168.0.1;port=9160,host=192.168.0.2,port=9160";

However, what do I do if I don't know what the IP's are? What happens if I add new nodes? Old nodes fail, etc etc? Do you have to somehow load balance the requests yourself?

Any advice on the above would be hugely appreciated!

Cheers

Schodemeiss
  • 230
  • 1
  • 2
  • 7

1 Answers1

0

This pdo check the first available node on the list. If the first node seems to be down, he uses the second... You have to load balance by yourself (in our case we shuffle the list of nodes ). But be carefull about this. The node you join is not necessary the node who handle the row you want to read/write. It's just a coordinator who handle the request. If you add new nodes, you have to add his ip if you want to use it as a possible coordinator but this does not affect the operation of the cluster itself.

Jérémy Munoz
  • 344
  • 2
  • 8