Thanks for the help Aaron. I sorted it out: the problem was that I was using the latest version of pycassa against cassandra 0.6.x.
When I downloaded the 0.3.0 pycassa and used the previous api, all worked properly. Cheers, db On Wed, Jul 28, 2010 at 2:44 PM, Aaron Morton <[email protected]>wrote: > Just checking the obvious, your connecting to the local host so is this > code running on one of the machines with the cassandra installed ? > > Second, assuming your using the current git hub source, put a break point > in connection.py at line 191 > to see what the actual error is when it tries to connect. > > Aaron > > > On 28 Jul, 2010,at 07:26 AM, Daniel Bernstein <[email protected]> > wrote: > > I've set up a 2 node cluster and I'm trying to connect using pycassa. > > My thrift address is set to the default: localhost:9160 > > I've verified that the port is open and I'm able to connect to it via > telnet. > > My keyspace "Ananda" is defined as is the column family "URL" in > storage.xml > > Running the following commands locally, I get this: > > > >>> client = pycassa.connect("Ananda", ['127.0.0.1:9160'],timeout=3.5) > >>> cf = pycassa.ColumnFamily(client, "URL") > >>> cf.insert("foo", {"bar":"value"}) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "pycassa/columnfamily.py", line 332, in insert > self._wcl(write_consistency_level)) > File "pycassa/connection.py", line 164, in _client_call > conn = self._ensure_connection() > File "pycassa/connection.py", line 175, in _ensure_connection > conn = self.connect() > File "pycassa/connection.py", line 193, in connect > return self.connect() > File "pycassa/connection.py", line 186, in connect > server = self._servers.get() > File "pycassa/connection.py", line 136, in get > raise NoServerAvailable() > pycassa.connection.NoServerAvailable > > > NB: When I try to connect without any timeout, it just hangs. > When I shutdown cassandra, it fails immediately (rather than failing in 3.5 > seconds when I use a timeout). > > Any help would be much appreciated. > > --Daniel > >
