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: - Cassandra1 - Cassandra2 - Cassandra3 - Cassandra4 - 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=;port=9160,host=,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!



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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.