Re: is it possible to run cassandra process in client mode as smart proxy
Piavlo <lolitushka <at> gmail.com>
2012-05-16 11:01:43 GMT
On 05/16/2012 01:24 PM, R. Verlangen wrote:
Hi there,
I'm using HAProxy for PHP projects to take care of this. It
improved connection pooling enormous on the client side: with
preserving failover capabilities. Maybe that is something for
you to use in combination with PHP.
I already use it exactly like this :)
But i don't think it's a good solution. And it's totally unaware of
thrift/cassandra protocol, it's was pretty well discussed here
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Cassandra-amp-HAProxy-td5473144.html
I even see the plain tcp healchecks failing from time to time for no
reason.
I'm planning to make it a bit smarter with localhost http level
healthchecks - where it would make a cassandra write to CF in
keyspace wich has replication of 1, and will write to a key that
maps to the specific cassandra node being checked by healthcheck (of
course the keys need to be recaclulated each time the cluster is
rebalanced).
But IMHO it's very very ugly hack, and not as reliable as real smart
proxy which is way more superior and efficient (especially if it
could do the reads/writes coordination itself).
Haproxy also has an issue that then once of the backend ip changes
(which happens often in clouds) it's has to be restarted to resolve
the the correct hostname,
though it looks like Willy is finally seriously considering to
implement more dynamic for hostnames lookups (which was not the
case about a year ago then I asked for such feature)
the problem was is discussed here recently -
http://marc.info/?l=haproxy&m=133559164408814&w=1
haproxy has some more issues - i don't remember off top of my head.
Smart proxy would simply not have all those issues, as it's aware of
the ring state and the protocol and if smaprt proxy was the
cassandra itself then it would have all the needed features tested
and reliable at no effort.
Thanks
Alex
Good luck!
2012/5/16 Piavlo
<lolitushka <at> gmail.com>
Hi,
I'm interested in using some smart proxy cassandra process
that could act as coordinator node and be aware of cluster
state.
And run this smart proxy cassandra process on each client
side host where the application(php) with short lived
cassandra connections runs.
Besides being aware of cluster state if it could act as
coordinator node it would save unneeded network trips.
And maybe even have an option to take care of hinted
handoffs.
IMHO the best candidate for this is the cassandra itself
(like it's done in elasticsearch http://www.elasticsearch.org/guide/reference/modules/node.html)
I also see there was a work done in this direction at https://issues.apache.org/jira/browse/CASSANDRA-535
So maybe this is something that is already usable?
Or maybe there is some third party project that could be
used as smart cassandra proxy?
Thanks
Alex
--
With kind regards,
Robin Verlangen