You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by J T <jt...@googlemail.com> on 2010/03/04 09:02:23 UTC

Using Cassandra via the Erlang Thrift Client API (HOW ??)

Hi,

I've been trying to piece together some notion of how to use cassandra from
an erlang client.

So far I have managed to come up with the following, but it doesn't work.

Unfortunately there does not seem to be any decent documentation on the
subject I can find with googling so I'm hoping some more experienced members
of this mailing list can point out what I'm doing wrong.

I'm using cassandra 0.5, and I think the latest version of thrift.

I generated the thrift erlang client code using:

$ thrift -r --gen erl cassandra.thrift

And compiled and copied that into my ebin area, along with the rest of the
thrift erlc library code.

I start cassandra using its default config bin/cassandra -f and there are no
apparent errors:

$ bin/cassandra -f
Listening for transport dt_socket at address: 8888
INFO - Sampling index for
/var/lib/cassandra/data/system/LocationInfo-9-Data.db
INFO - Replaying /var/lib/cassandra/commitlog/CommitLog-1267655779083.log
INFO - Log replay complete
INFO - Saved Token found: 141354730401634313333347303685581151939
INFO - Starting up server gossip
INFO - Cassandra starting up...

then after a few seconds, it displays this:

Debugger failed to attach: timeout during handshake

Then from an erl vm I try the following:

rr(cassandra_types).
{ok, C} = thrift_client:start_link("localhost",8888, cassandra_thrift).
thrift_client:call( C,
                   'insert',
                   [ "Keyspace1",
                     "1",
                     #columnPath{column_family="Standard1", column="email"},
                     "ted@example.com",
                     1,
                     1
                     ] ).

Unfortunately, although I get a cassandra_thrift client connection, the call
to insert fails with :

=ERROR REPORT==== 4-Mar-2010::07:57:50 ===
** Generic server <0.333.0> terminating
** Last message in was {call,insert,
                             ["Keyspace1","1",
                              {columnPath,"Standard1",undefined,"email"},
                              "ted@example.com",1,1]}
** When Server state == {state,cassandra_thrift,
                         {protocol,thrift_binary_protocol,
                          {binary_protocol,
                           {transport,thrift_buffered_transport,<0.334.0>},
                           true,true}},
                         0}
** Reason for termination ==
** {{case_clause,{error,closed}},
    [{thrift_client,read_result,3},
     {thrift_client,catch_function_exceptions,2},
     {thrift_client,handle_call,3},
     {gen_server,handle_msg,5},
     {proc_lib,init_p_do_apply,3}]}
** exception exit: {case_clause,{error,closed}}
     in function  thrift_client:read_result/3
     in call from thrift_client:catch_function_exceptions/2
     in call from thrift_client:handle_call/3
     in call from gen_server:handle_msg/5
     in call from proc_lib:init_p_do_apply/3

Cassandra itself reports nothing.

-- JT.

Re: Using Cassandra via the Erlang Thrift Client API (HOW ??)

Posted by Jonathan Ellis <jb...@gmail.com>.
You probably need to switch the server to framed thrift mode.

On Thu, Mar 4, 2010 at 2:02 AM, J T <jt...@googlemail.com> wrote:
> Hi,
> I've been trying to piece together some notion of how to use cassandra from
> an erlang client.
> So far I have managed to come up with the following, but it doesn't work.
> Unfortunately there does not seem to be any decent documentation on the
> subject I can find with googling so I'm hoping some more experienced members
> of this mailing list can point out what I'm doing wrong.
> I'm using cassandra 0.5, and I think the latest version of thrift.
> I generated the thrift erlang client code using:
> $ thrift -r --gen erl cassandra.thrift
> And compiled and copied that into my ebin area, along with the rest of the
> thrift erlc library code.
> I start cassandra using its default config bin/cassandra -f and there are no
> apparent errors:
> $ bin/cassandra -f
> Listening for transport dt_socket at address: 8888
> INFO - Sampling index for
> /var/lib/cassandra/data/system/LocationInfo-9-Data.db
> INFO - Replaying /var/lib/cassandra/commitlog/CommitLog-1267655779083.log
> INFO - Log replay complete
> INFO - Saved Token found: 141354730401634313333347303685581151939
> INFO - Starting up server gossip
> INFO - Cassandra starting up...
> then after a few seconds, it displays this:
> Debugger failed to attach: timeout during handshake
> Then from an erl vm I try the following:
> rr(cassandra_types).
> {ok, C} = thrift_client:start_link("localhost",8888, cassandra_thrift).
> thrift_client:call( C,
>                    'insert',
>                    [ "Keyspace1",
>                      "1",
>                      #columnPath{column_family="Standard1", column="email"},
>                      "ted@example.com",
>                      1,
>                      1
>                      ] ).
> Unfortunately, although I get a cassandra_thrift client connection, the call
> to insert fails with :
> =ERROR REPORT==== 4-Mar-2010::07:57:50 ===
> ** Generic server <0.333.0> terminating
> ** Last message in was {call,insert,
>                              ["Keyspace1","1",
>                               {columnPath,"Standard1",undefined,"email"},
>                               "ted@example.com",1,1]}
> ** When Server state == {state,cassandra_thrift,
>                          {protocol,thrift_binary_protocol,
>                           {binary_protocol,
>                            {transport,thrift_buffered_transport,<0.334.0>},
>                            true,true}},
>                          0}
> ** Reason for termination ==
> ** {{case_clause,{error,closed}},
>     [{thrift_client,read_result,3},
>      {thrift_client,catch_function_exceptions,2},
>      {thrift_client,handle_call,3},
>      {gen_server,handle_msg,5},
>      {proc_lib,init_p_do_apply,3}]}
> ** exception exit: {case_clause,{error,closed}}
>      in function  thrift_client:read_result/3
>      in call from thrift_client:catch_function_exceptions/2
>      in call from thrift_client:handle_call/3
>      in call from gen_server:handle_msg/5
>      in call from proc_lib:init_p_do_apply/3
> Cassandra itself reports nothing.
> -- JT.

Re: Using Cassandra via the Erlang Thrift Client API (HOW ??)

Posted by nilskyone <ni...@gmail.com>.
Greetings,


I am also exploring erlang and cassandra via thrift..

but when inserting i've encountered this error.


(test@ubuntu)11> thrift_client:call(C,'insert',[
"Keyspace1","1",#columnPath{column_family="Standard1", column="email"},
"ted@example.com",1,1 ]).

=ERROR REPORT==== 8-Jun-2010::15:07:58 ===
** Generic server <0.118.0> terminating 
** Last message in was {call,insert,
                             ["Keyspace1","1",
                              {columnPath,"Standard1",undefined,"email"},
                              "ted@example.com",1,1]}
** When Server state == {state,cassandra_thrift,
                         {protocol,thrift_binary_protocol,
                          {binary_protocol,
                           {transport,thrift_buffered_transport,<0.119.0>},
                           true,true}},
                         0}
** Reason for termination == 
** {'module could not be loaded',
       [{cassandra_thrift,function_info,[insert,params_type]},
        {thrift_client,send_function_call,3},
        {thrift_client,'-handle_call/3-fun-0-',3},
        {thrift_client,catch_function_exceptions,2},
        {thrift_client,handle_call,3},
        {gen_server,handle_msg,5},
        {proc_lib,init_p_do_apply,3}]}
** exception exit: undef
     in function  cassandra_thrift:function_info/2
        called as cassandra_thrift:function_info(insert,params_type)
     in call from thrift_client:send_function_call/3
     in call from thrift_client:'-handle_call/3-fun-0-'/3
     in call from thrift_client:catch_function_exceptions/2
     in call from thrift_client:handle_call/3
     in call from gen_server:handle_msg/5
     in call from proc_lib:init_p_do_apply/3


Is there anyone who encountered the problem above. :)


thanks in advanced :)

- Niel Riddle :)

-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Using-Cassandra-via-the-Erlang-Thrift-Client-API-HOW-tp4672926p5152514.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Using Cassandra via the Erlang Thrift Client API (HOW ??)

Posted by Brandon Williams <dr...@gmail.com>.
On Thu, Mar 4, 2010 at 11:27 AM, J T <jt...@googlemail.com> wrote:

> Once I have something working I'll write a new post back with a couple of
> examples here to help future newbies on how to talk to cassandra from
> erlang, since those examples are not present on the cassandra/thrift wiki as
> far as I can tell.
>

Could you update the wiki instead? :)
http://wiki.apache.org/cassandra/ClientExamples

-Brandon

Re: Using Cassandra via the Erlang Thrift Client API (HOW ??)

Posted by Jonathan Ellis <jb...@gmail.com>.
On Thu, Mar 4, 2010 at 11:27 AM, J T <jt...@googlemail.com> wrote:
> Hi All,
> Many thanks for the responses. You helped enormously. I was in fact talking
> to the wrong port. It should have been 9160 rather than 8888.
> I just assumed that the port the cassandra server displayed when starting up
> was the one I should be talking to, my bad. I should have read the config
> file.

Thanks for the feedback, I've made this more clear in
https://issues.apache.org/jira/browse/CASSANDRA-849 on the 0.6 branch.

> Once I have something working I'll write a new post back with a couple of
> examples here to help future newbies on how to talk to cassandra from
> erlang, since those examples are not present on the cassandra/thrift wiki as
> far as I can tell.

That would be great!

Re: Using Cassandra via the Erlang Thrift Client API (HOW ??)

Posted by J T <jt...@googlemail.com>.
Hi All,

Many thanks for the responses. You helped enormously. I was in fact talking
to the wrong port. It should have been 9160 rather than 8888.
I just assumed that the port the cassandra server displayed when starting up
was the one I should be talking to, my bad. I should have read the config
file.

Once I have something working I'll write a new post back with a couple of
examples here to help future newbies on how to talk to cassandra from
erlang, since those examples are not present on the cassandra/thrift wiki as
far as I can tell.

Thanks,

Jason

On Thu, Mar 4, 2010 at 1:34 PM, <Je...@nokia.com> wrote:

> I think you want port 9160, not 8888... dt_socket != thrift.
>
> Jeremey.
>
> On Mar 4, 2010, at 2:02 AM, ext J T wrote:
>
> > Hi,
> >
> > I've been trying to piece together some notion of how to use cassandra
> from an erlang client.
> >
> > So far I have managed to come up with the following, but it doesn't work.
> >
> > Unfortunately there does not seem to be any decent documentation on the
> subject I can find with googling so I'm hoping some more experienced members
> of this mailing list can point out what I'm doing wrong.
> >
> > I'm using cassandra 0.5, and I think the latest version of thrift.
> >
> > I generated the thrift erlang client code using:
> >
> > $ thrift -r --gen erl cassandra.thrift
> >
> > And compiled and copied that into my ebin area, along with the rest of
> the thrift erlc library code.
> >
> > I start cassandra using its default config bin/cassandra -f and there are
> no apparent errors:
> >
> > $ bin/cassandra -f
> > Listening for transport dt_socket at address: 8888
> > INFO - Sampling index for
> /var/lib/cassandra/data/system/LocationInfo-9-Data.db
> > INFO - Replaying /var/lib/cassandra/commitlog/CommitLog-1267655779083.log
> > INFO - Log replay complete
> > INFO - Saved Token found: 141354730401634313333347303685581151939
> > INFO - Starting up server gossip
> > INFO - Cassandra starting up...
> >
> > then after a few seconds, it displays this:
> >
> > Debugger failed to attach: timeout during handshake
> >
> > Then from an erl vm I try the following:
> >
> > rr(cassandra_types).
> > {ok, C} = thrift_client:start_link("localhost",8888, cassandra_thrift).
> > thrift_client:call( C,
> >                   'insert',
> >                   [ "Keyspace1",
> >                     "1",
> >                     #columnPath{column_family="Standard1",
> column="email"},
> >                     "ted@example.com<ma...@example.com>",
> >                     1,
> >                     1
> >                     ] ).
> >
> > Unfortunately, although I get a cassandra_thrift client connection, the
> call to insert fails with :
> >
> > =ERROR REPORT==== 4-Mar-2010::07:57:50 ===
> > ** Generic server <0.333.0> terminating
> > ** Last message in was {call,insert,
> >                             ["Keyspace1","1",
> >                              {columnPath,"Standard1",undefined,"email"},
> >                              "ted@example.com<mailto:ted@example.com
> >",1,1]}
> > ** When Server state == {state,cassandra_thrift,
> >                         {protocol,thrift_binary_protocol,
> >                          {binary_protocol,
> >
> {transport,thrift_buffered_transport,<0.334.0>},
> >                           true,true}},
> >                         0}
> > ** Reason for termination ==
> > ** {{case_clause,{error,closed}},
> >    [{thrift_client,read_result,3},
> >     {thrift_client,catch_function_exceptions,2},
> >     {thrift_client,handle_call,3},
> >     {gen_server,handle_msg,5},
> >     {proc_lib,init_p_do_apply,3}]}
> > ** exception exit: {case_clause,{error,closed}}
> >     in function  thrift_client:read_result/3
> >     in call from thrift_client:catch_function_exceptions/2
> >     in call from thrift_client:handle_call/3
> >     in call from gen_server:handle_msg/5
> >     in call from proc_lib:init_p_do_apply/3
> >
> > Cassandra itself reports nothing.
> >
> > -- JT.
>
>

Re: Using Cassandra via the Erlang Thrift Client API (HOW ??)

Posted by Je...@nokia.com.
I think you want port 9160, not 8888... dt_socket != thrift.

Jeremey.

On Mar 4, 2010, at 2:02 AM, ext J T wrote:

> Hi,
> 
> I've been trying to piece together some notion of how to use cassandra from an erlang client.
> 
> So far I have managed to come up with the following, but it doesn't work.
> 
> Unfortunately there does not seem to be any decent documentation on the subject I can find with googling so I'm hoping some more experienced members of this mailing list can point out what I'm doing wrong.
> 
> I'm using cassandra 0.5, and I think the latest version of thrift.
> 
> I generated the thrift erlang client code using:
> 
> $ thrift -r --gen erl cassandra.thrift
> 
> And compiled and copied that into my ebin area, along with the rest of the thrift erlc library code.
> 
> I start cassandra using its default config bin/cassandra -f and there are no apparent errors:
> 
> $ bin/cassandra -f
> Listening for transport dt_socket at address: 8888
> INFO - Sampling index for /var/lib/cassandra/data/system/LocationInfo-9-Data.db
> INFO - Replaying /var/lib/cassandra/commitlog/CommitLog-1267655779083.log
> INFO - Log replay complete
> INFO - Saved Token found: 141354730401634313333347303685581151939
> INFO - Starting up server gossip
> INFO - Cassandra starting up...
> 
> then after a few seconds, it displays this:
> 
> Debugger failed to attach: timeout during handshake
> 
> Then from an erl vm I try the following:
> 
> rr(cassandra_types).
> {ok, C} = thrift_client:start_link("localhost",8888, cassandra_thrift).
> thrift_client:call( C,
>                   'insert',
>                   [ "Keyspace1",
>                     "1",
>                     #columnPath{column_family="Standard1", column="email"},
>                     "ted@example.com<ma...@example.com>",
>                     1,
>                     1
>                     ] ).
> 
> Unfortunately, although I get a cassandra_thrift client connection, the call to insert fails with :
> 
> =ERROR REPORT==== 4-Mar-2010::07:57:50 ===
> ** Generic server <0.333.0> terminating
> ** Last message in was {call,insert,
>                             ["Keyspace1","1",
>                              {columnPath,"Standard1",undefined,"email"},
>                              "ted@example.com<ma...@example.com>",1,1]}
> ** When Server state == {state,cassandra_thrift,
>                         {protocol,thrift_binary_protocol,
>                          {binary_protocol,
>                           {transport,thrift_buffered_transport,<0.334.0>},
>                           true,true}},
>                         0}
> ** Reason for termination ==
> ** {{case_clause,{error,closed}},
>    [{thrift_client,read_result,3},
>     {thrift_client,catch_function_exceptions,2},
>     {thrift_client,handle_call,3},
>     {gen_server,handle_msg,5},
>     {proc_lib,init_p_do_apply,3}]}
> ** exception exit: {case_clause,{error,closed}}
>     in function  thrift_client:read_result/3
>     in call from thrift_client:catch_function_exceptions/2
>     in call from thrift_client:handle_call/3
>     in call from gen_server:handle_msg/5
>     in call from proc_lib:init_p_do_apply/3
> 
> Cassandra itself reports nothing.
> 
> -- JT.


Re: Using Cassandra via the Erlang Thrift Client API (HOW ??)

Posted by Ted Dunning <te...@gmail.com>.
A code patch to improve the startup messages might be very useful as well.

On Thu, Mar 4, 2010 at 9:27 AM, J T <jt...@googlemail.com> wrote:

> Once I have something working I'll write a new post back with a couple of
> examples here to help future newbies on how to talk to cassandra from
> erlang, since those examples are not present on the cassandra/thrift wiki
> as
> far as I can tell.
>



-- 
Ted Dunning, CTO
DeepDyve

Re: Using Cassandra via the Erlang Thrift Client API (HOW ??)

Posted by J T <jt...@googlemail.com>.
Hi All,

Many thanks for the responses. You helped enormously. I was in fact talking
to the wrong port. It should have been 9160 rather than 8888.
I just assumed that the port the cassandra server displayed when starting up
was the one I should be talking to, my bad. I should have read the config
file.

Once I have something working I'll write a new post back with a couple of
examples here to help future newbies on how to talk to cassandra from
erlang, since those examples are not present on the cassandra/thrift wiki as
far as I can tell.

Thanks,

Jason

On Thu, Mar 4, 2010 at 4:31 PM, Todd Lipcon <to...@cloudera.com> wrote:

> Hi JT,
>
> Is 8888 the thrift port or Cassandra's internal protocol? It's been a while
> since I used Cassandra, but I thought that was the port for gossip, etc?
>
> -Todd
>
> On Thu, Mar 4, 2010 at 12:07 AM, J T <jt...@googlemail.com> wrote:
>
> > Hi,
> >
> > I've been trying to piece together some notion of how to use cassandra
> from
> > an erlang client.
> >
> > So far I have managed to come up with the following, but it doesn't work.
> >
> > Unfortunately there does not seem to be any decent documentation on the
> > subject I can find with googling so I'm hoping some more experienced
> > members
> > of this mailing list can point out what I'm doing wrong.
> >
> > I'm using cassandra 0.5, and I think the latest version of thrift.
> >
> > I generated the thrift erlang client code using:
> >
> > $ thrift -r --gen erl cassandra.thrift
> >
> > And compiled and copied that into my ebin area, along with the rest of
> the
> > thrift erlc library code.
> >
> > I start cassandra using its default config bin/cassandra -f and there are
> > no
> > apparent errors:
> >
> > $ bin/cassandra -f
> > Listening for transport dt_socket at address: 8888
> > INFO - Sampling index for
> > /var/lib/cassandra/data/system/LocationInfo-9-Data.db
> > INFO - Replaying /var/lib/cassandra/commitlog/CommitLog-1267655779083.log
> > INFO - Log replay complete
> > INFO - Saved Token found: 141354730401634313333347303685581151939
> > INFO - Starting up server gossip
> > INFO - Cassandra starting up...
> >
> > then after a few seconds, it displays this:
> >
> > Debugger failed to attach: timeout during handshake
> >
> > Then from an erl vm I try the following:
> >
> > rr(cassandra_types).
> > {ok, C} = thrift_client:start_link("localhost",8888, cassandra_thrift).
> > thrift_client:call( C,
> >                   'insert',
> >                   [ "Keyspace1",
> >                     "1",
> >                     #columnPath{column_family="Standard1",
> column="email"},
> >                     "ted@example.com",
> >                     1,
> >                     1
> >                     ] ).
> >
> > Unfortunately, although I get a cassandra_thrift client connection, the
> > call
> > to insert fails with :
> >
> > =ERROR REPORT==== 4-Mar-2010::07:57:50 ===
> > ** Generic server <0.333.0> terminating
> > ** Last message in was {call,insert,
> >                             ["Keyspace1","1",
> >                              {columnPath,"Standard1",undefined,"email"},
> >                              "ted@example.com",1,1]}
> > ** When Server state == {state,cassandra_thrift,
> >                         {protocol,thrift_binary_protocol,
> >                          {binary_protocol,
> >
> {transport,thrift_buffered_transport,<0.334.0>},
> >                           true,true}},
> >                         0}
> > ** Reason for termination ==
> > ** {{case_clause,{error,closed}},
> >    [{thrift_client,read_result,3},
> >     {thrift_client,catch_function_exceptions,2},
> >     {thrift_client,handle_call,3},
> >     {gen_server,handle_msg,5},
> >     {proc_lib,init_p_do_apply,3}]}
> > ** exception exit: {case_clause,{error,closed}}
> >     in function  thrift_client:read_result/3
> >     in call from thrift_client:catch_function_exceptions/2
> >     in call from thrift_client:handle_call/3
> >     in call from gen_server:handle_msg/5
> >     in call from proc_lib:init_p_do_apply/3
> >
> > Cassandra itself reports nothing.
> >
> > -- JT.
> >
>

Re: Using Cassandra via the Erlang Thrift Client API (HOW ??)

Posted by Todd Lipcon <to...@cloudera.com>.
Hi JT,

Is 8888 the thrift port or Cassandra's internal protocol? It's been a while
since I used Cassandra, but I thought that was the port for gossip, etc?

-Todd

On Thu, Mar 4, 2010 at 12:07 AM, J T <jt...@googlemail.com> wrote:

> Hi,
>
> I've been trying to piece together some notion of how to use cassandra from
> an erlang client.
>
> So far I have managed to come up with the following, but it doesn't work.
>
> Unfortunately there does not seem to be any decent documentation on the
> subject I can find with googling so I'm hoping some more experienced
> members
> of this mailing list can point out what I'm doing wrong.
>
> I'm using cassandra 0.5, and I think the latest version of thrift.
>
> I generated the thrift erlang client code using:
>
> $ thrift -r --gen erl cassandra.thrift
>
> And compiled and copied that into my ebin area, along with the rest of the
> thrift erlc library code.
>
> I start cassandra using its default config bin/cassandra -f and there are
> no
> apparent errors:
>
> $ bin/cassandra -f
> Listening for transport dt_socket at address: 8888
> INFO - Sampling index for
> /var/lib/cassandra/data/system/LocationInfo-9-Data.db
> INFO - Replaying /var/lib/cassandra/commitlog/CommitLog-1267655779083.log
> INFO - Log replay complete
> INFO - Saved Token found: 141354730401634313333347303685581151939
> INFO - Starting up server gossip
> INFO - Cassandra starting up...
>
> then after a few seconds, it displays this:
>
> Debugger failed to attach: timeout during handshake
>
> Then from an erl vm I try the following:
>
> rr(cassandra_types).
> {ok, C} = thrift_client:start_link("localhost",8888, cassandra_thrift).
> thrift_client:call( C,
>                   'insert',
>                   [ "Keyspace1",
>                     "1",
>                     #columnPath{column_family="Standard1", column="email"},
>                     "ted@example.com",
>                     1,
>                     1
>                     ] ).
>
> Unfortunately, although I get a cassandra_thrift client connection, the
> call
> to insert fails with :
>
> =ERROR REPORT==== 4-Mar-2010::07:57:50 ===
> ** Generic server <0.333.0> terminating
> ** Last message in was {call,insert,
>                             ["Keyspace1","1",
>                              {columnPath,"Standard1",undefined,"email"},
>                              "ted@example.com",1,1]}
> ** When Server state == {state,cassandra_thrift,
>                         {protocol,thrift_binary_protocol,
>                          {binary_protocol,
>                           {transport,thrift_buffered_transport,<0.334.0>},
>                           true,true}},
>                         0}
> ** Reason for termination ==
> ** {{case_clause,{error,closed}},
>    [{thrift_client,read_result,3},
>     {thrift_client,catch_function_exceptions,2},
>     {thrift_client,handle_call,3},
>     {gen_server,handle_msg,5},
>     {proc_lib,init_p_do_apply,3}]}
> ** exception exit: {case_clause,{error,closed}}
>     in function  thrift_client:read_result/3
>     in call from thrift_client:catch_function_exceptions/2
>     in call from thrift_client:handle_call/3
>     in call from gen_server:handle_msg/5
>     in call from proc_lib:init_p_do_apply/3
>
> Cassandra itself reports nothing.
>
> -- JT.
>

Using Cassandra via the Erlang Thrift Client API (HOW ??)

Posted by J T <jt...@googlemail.com>.
Hi,

I've been trying to piece together some notion of how to use cassandra from
an erlang client.

So far I have managed to come up with the following, but it doesn't work.

Unfortunately there does not seem to be any decent documentation on the
subject I can find with googling so I'm hoping some more experienced members
of this mailing list can point out what I'm doing wrong.

I'm using cassandra 0.5, and I think the latest version of thrift.

I generated the thrift erlang client code using:

$ thrift -r --gen erl cassandra.thrift

And compiled and copied that into my ebin area, along with the rest of the
thrift erlc library code.

I start cassandra using its default config bin/cassandra -f and there are no
apparent errors:

$ bin/cassandra -f
Listening for transport dt_socket at address: 8888
INFO - Sampling index for
/var/lib/cassandra/data/system/LocationInfo-9-Data.db
INFO - Replaying /var/lib/cassandra/commitlog/CommitLog-1267655779083.log
INFO - Log replay complete
INFO - Saved Token found: 141354730401634313333347303685581151939
INFO - Starting up server gossip
INFO - Cassandra starting up...

then after a few seconds, it displays this:

Debugger failed to attach: timeout during handshake

Then from an erl vm I try the following:

rr(cassandra_types).
{ok, C} = thrift_client:start_link("localhost",8888, cassandra_thrift).
thrift_client:call( C,
                   'insert',
                   [ "Keyspace1",
                     "1",
                     #columnPath{column_family="Standard1", column="email"},
                     "ted@example.com",
                     1,
                     1
                     ] ).

Unfortunately, although I get a cassandra_thrift client connection, the call
to insert fails with :

=ERROR REPORT==== 4-Mar-2010::07:57:50 ===
** Generic server <0.333.0> terminating
** Last message in was {call,insert,
                             ["Keyspace1","1",
                              {columnPath,"Standard1",undefined,"email"},
                              "ted@example.com",1,1]}
** When Server state == {state,cassandra_thrift,
                         {protocol,thrift_binary_protocol,
                          {binary_protocol,
                           {transport,thrift_buffered_transport,<0.334.0>},
                           true,true}},
                         0}
** Reason for termination ==
** {{case_clause,{error,closed}},
    [{thrift_client,read_result,3},
     {thrift_client,catch_function_exceptions,2},
     {thrift_client,handle_call,3},
     {gen_server,handle_msg,5},
     {proc_lib,init_p_do_apply,3}]}
** exception exit: {case_clause,{error,closed}}
     in function  thrift_client:read_result/3
     in call from thrift_client:catch_function_exceptions/2
     in call from thrift_client:handle_call/3
     in call from gen_server:handle_msg/5
     in call from proc_lib:init_p_do_apply/3

Cassandra itself reports nothing.

-- JT.