incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Robson <mar...@gmail.com>
Subject Re: Connecting to the cluster with failover (was: data modeling question)
Date Mon, 07 Dec 2009 19:40:20 GMT
2009/12/7 Ramzi Rabah <rrabah@playdom.com>

>                TSocket socket = new TSocket(hostName, port);
>                TBinaryProtocol binaryProtocol = new
> TBinaryProtocol(socket, false, false);
>                Cassandra.Client client = new
> Cassandra.Client(binaryProtocol);
>                socket.open();
>                Map<String,String> tokenToHostMap = (Map<String,String>)
>                        new
>
> JSONTokener(client.get_string_property(CassandraServer.TOKEN_MAP)).nextValue();
>
> this will return a list of servers in the cluster (both up or down).
>
> You will obviously need to connect to a live node in the cluster to be
> able to run this.
>

Right, and an application could connect to a known live node (seed node,
etc) periodically and store the result (retaining the previous values if it
was unable to connect).

That wouldn't solve the problem of being able to connect to a node which is
available, *right now*. To do that reliably and with minimal latency you'd
need something which Cassandra doesn't easily have, a load-balancer/ high
availability setup.

Personally I'd like to see Cassandra implement a "Front-end-only" node,
which could run as a thrift protocol server but not join the ring itself
hence not requiring persistent storage. This would mean that app servers
could run a local front-end-only server and just talk to that.

Mark

Mime
View raw message