You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Morten Wegelbye Nissen <mw...@monit.dk> on 2010/09/19 23:31:13 UTC

Connection issue with trunk using .net

  Hello List,

Knowing this question might be more in the area of thrift then 
cassandra, here goes:

I have been trying to do some research in using cassandra as backend for 
a system build for .net, but for some reason my client seams to terminat 
no matter what I do.

I am using latest from trunk, using the CliClient everything seams to 
work, I can insert and get data.

What I have done so far, I have noticed that the thrift.jar is build 
from r959516 of the thrift project - so I have fetched that from the 
thrift project.
I have used the thrift.exe to generate the source from cassandra.thrift.
Boiled it together in a C# project, and start to run it.
But, as soon as I issue the first RPC command, a IOException( Unable to 
write data to the transport connection: An established connection was 
aborted by the software in your host machine. ) i thrown.

I have used netcat to setup a "fake" cassandra server to ensure that it 
is nothing to do with firewall or network issues. And here I see data.

The code to I use is:
TTransport transport = new TSocket("192.168.0.103", 9160);
TProtocol protocol = new TBinaryProtocol(transport);
transport.Open();
Cassandra.Client client = new Cassandra.Client(protocol);
Dictionary<string,string> auth = new Dictionary<string,string>( );
auth.Add( "dilbert", "nomoovertime" );
AuthenticationRequest ar = new AuthenticationRequest();
ar.Credentials = auth;
client.send_login( ar );

Any clues, help, directions would be really appreciated,
Morten


Re: Connection issue with trunk using .net

Posted by Lucas Nodine <lu...@gmail.com>.
try this bit...


TTransport transport = new TFramedTransport(new
TSocket(Settings.Instance.Host.Address.ToString(),
Settings.Instance.Host.Port));

TProtocol protocol = new TBinaryProtocol(transport);

Cassandra.Client cassandra = new Cassandra.Client(protocol);
HTH,

- Lucas

On Sun, Sep 19, 2010 at 6:50 PM, Jonathan Ellis <jb...@gmail.com> wrote:

> it doesn't look like you're enabling framed mode.  trunk changes
> framed to default on.
>
> On Sun, Sep 19, 2010 at 4:31 PM, Morten Wegelbye Nissen <mw...@monit.dk>
> wrote:
> >  Hello List,
> >
> > Knowing this question might be more in the area of thrift then cassandra,
> > here goes:
> >
> > I have been trying to do some research in using cassandra as backend for
> a
> > system build for .net, but for some reason my client seams to terminat no
> > matter what I do.
> >
> > I am using latest from trunk, using the CliClient everything seams to
> work,
> > I can insert and get data.
> >
> > What I have done so far, I have noticed that the thrift.jar is build from
> > r959516 of the thrift project - so I have fetched that from the thrift
> > project.
> > I have used the thrift.exe to generate the source from cassandra.thrift.
> > Boiled it together in a C# project, and start to run it.
> > But, as soon as I issue the first RPC command, a IOException( Unable to
> > write data to the transport connection: An established connection was
> > aborted by the software in your host machine. ) i thrown.
> >
> > I have used netcat to setup a "fake" cassandra server to ensure that it
> is
> > nothing to do with firewall or network issues. And here I see data.
> >
> > The code to I use is:
> > TTransport transport = new TSocket("192.168.0.103", 9160);
> > TProtocol protocol = new TBinaryProtocol(transport);
> > transport.Open();
> > Cassandra.Client client = new Cassandra.Client(protocol);
> > Dictionary<string,string> auth = new Dictionary<string,string>( );
> > auth.Add( "dilbert", "nomoovertime" );
> > AuthenticationRequest ar = new AuthenticationRequest();
> > ar.Credentials = auth;
> > client.send_login( ar );
> >
> > Any clues, help, directions would be really appreciated,
> > Morten
> >
> >
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>

Re: Connection issue with trunk using .net

Posted by Jonathan Ellis <jb...@gmail.com>.
it doesn't look like you're enabling framed mode.  trunk changes
framed to default on.

On Sun, Sep 19, 2010 at 4:31 PM, Morten Wegelbye Nissen <mw...@monit.dk> wrote:
>  Hello List,
>
> Knowing this question might be more in the area of thrift then cassandra,
> here goes:
>
> I have been trying to do some research in using cassandra as backend for a
> system build for .net, but for some reason my client seams to terminat no
> matter what I do.
>
> I am using latest from trunk, using the CliClient everything seams to work,
> I can insert and get data.
>
> What I have done so far, I have noticed that the thrift.jar is build from
> r959516 of the thrift project - so I have fetched that from the thrift
> project.
> I have used the thrift.exe to generate the source from cassandra.thrift.
> Boiled it together in a C# project, and start to run it.
> But, as soon as I issue the first RPC command, a IOException( Unable to
> write data to the transport connection: An established connection was
> aborted by the software in your host machine. ) i thrown.
>
> I have used netcat to setup a "fake" cassandra server to ensure that it is
> nothing to do with firewall or network issues. And here I see data.
>
> The code to I use is:
> TTransport transport = new TSocket("192.168.0.103", 9160);
> TProtocol protocol = new TBinaryProtocol(transport);
> transport.Open();
> Cassandra.Client client = new Cassandra.Client(protocol);
> Dictionary<string,string> auth = new Dictionary<string,string>( );
> auth.Add( "dilbert", "nomoovertime" );
> AuthenticationRequest ar = new AuthenticationRequest();
> ar.Credentials = auth;
> client.send_login( ar );
>
> Any clues, help, directions would be really appreciated,
> Morten
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Re: Connection issue with trunk using .net

Posted by Michal Augustýn <au...@gmail.com>.
Yeah, the solution is the same. I wanted just to point out the connection
lag issue that Morten could face too.

Augi

2010/9/20 Michael Greene <mi...@gmail.com>

> Sorry, got threads mixed up, but yes the solution is the same.
>
>
> On Mon, Sep 20, 2010 at 12:40 PM, Michael Greene <michael.greene@gmail.com
> > wrote:
>
>> That... is this thread.  I'm glad the solution works for you Morten.
>>
>>
>> On Mon, Sep 20, 2010 at 12:33 PM, Michal Augustýn <
>> augustyn.michal@gmail.com> wrote:
>>
>>> Check this thread too:
>>> http://www.mail-archive.com/user@cassandra.apache.org/msg06024.html
>>>
>>> <http://www.mail-archive.com/user@cassandra.apache.org/msg06024.html>
>>> Augi
>>>
>>> 2010/9/20 Morten Wegelbye Nissen <mw...@monit.dk>
>>>
>>>  On 19-09-2010 23:50, Michael Greene wrote:
>>>>
>>>>> Trunk (and 0.7) use Thrift's framed transport, so you should wrap your
>>>>> TSocket in a TFramedTransport. On 0.6 and earlier you should have been
>>>>> wrapping with a TBufferedTransport for  better performance but the framed
>>>>> transport is inherently buffered.
>>>>>
>>>>>  Perfect, thanks.
>>>>
>>>> I might have noiticed this if I had tried this using the 6-branche
>>>>
>>>> ./Morten
>>>>
>>>
>>>
>>
>

Re: Connection issue with trunk using .net

Posted by Michael Greene <mi...@gmail.com>.
Sorry, got threads mixed up, but yes the solution is the same.

On Mon, Sep 20, 2010 at 12:40 PM, Michael Greene
<mi...@gmail.com>wrote:

> That... is this thread.  I'm glad the solution works for you Morten.
>
>
> On Mon, Sep 20, 2010 at 12:33 PM, Michal Augustýn <
> augustyn.michal@gmail.com> wrote:
>
>> Check this thread too:
>> http://www.mail-archive.com/user@cassandra.apache.org/msg06024.html
>>
>> <http://www.mail-archive.com/user@cassandra.apache.org/msg06024.html>Augi
>>
>> 2010/9/20 Morten Wegelbye Nissen <mw...@monit.dk>
>>
>>  On 19-09-2010 23:50, Michael Greene wrote:
>>>
>>>> Trunk (and 0.7) use Thrift's framed transport, so you should wrap your
>>>> TSocket in a TFramedTransport. On 0.6 and earlier you should have been
>>>> wrapping with a TBufferedTransport for  better performance but the framed
>>>> transport is inherently buffered.
>>>>
>>>>  Perfect, thanks.
>>>
>>> I might have noiticed this if I had tried this using the 6-branche
>>>
>>> ./Morten
>>>
>>
>>
>

Re: Connection issue with trunk using .net

Posted by Michael Greene <mi...@gmail.com>.
That... is this thread.  I'm glad the solution works for you Morten.

On Mon, Sep 20, 2010 at 12:33 PM, Michal Augustýn <augustyn.michal@gmail.com
> wrote:

> Check this thread too:
> http://www.mail-archive.com/user@cassandra.apache.org/msg06024.html
>
> <http://www.mail-archive.com/user@cassandra.apache.org/msg06024.html>Augi
>
> 2010/9/20 Morten Wegelbye Nissen <mw...@monit.dk>
>
>  On 19-09-2010 23:50, Michael Greene wrote:
>>
>>> Trunk (and 0.7) use Thrift's framed transport, so you should wrap your
>>> TSocket in a TFramedTransport. On 0.6 and earlier you should have been
>>> wrapping with a TBufferedTransport for  better performance but the framed
>>> transport is inherently buffered.
>>>
>>>  Perfect, thanks.
>>
>> I might have noiticed this if I had tried this using the 6-branche
>>
>> ./Morten
>>
>
>

Re: Connection issue with trunk using .net

Posted by Michal Augustýn <au...@gmail.com>.
Check this thread too:
http://www.mail-archive.com/user@cassandra.apache.org/msg06024.html

<http://www.mail-archive.com/user@cassandra.apache.org/msg06024.html>Augi

2010/9/20 Morten Wegelbye Nissen <mw...@monit.dk>

>  On 19-09-2010 23:50, Michael Greene wrote:
>
>> Trunk (and 0.7) use Thrift's framed transport, so you should wrap your
>> TSocket in a TFramedTransport. On 0.6 and earlier you should have been
>> wrapping with a TBufferedTransport for  better performance but the framed
>> transport is inherently buffered.
>>
>>  Perfect, thanks.
>
> I might have noiticed this if I had tried this using the 6-branche
>
> ./Morten
>

Re: Connection issue with trunk using .net

Posted by Morten Wegelbye Nissen <mw...@monit.dk>.
  On 19-09-2010 23:50, Michael Greene wrote:
> Trunk (and 0.7) use Thrift's framed transport, so you should wrap your TSocket in a TFramedTransport. On 0.6 and earlier you should have been wrapping with a TBufferedTransport for  better performance but the framed transport is inherently buffered.
>
Perfect, thanks.

I might have noiticed this if I had tried this using the 6-branche

./Morten

Re: Connection issue with trunk using .net

Posted by Michael Greene <mi...@gmail.com>.
Trunk (and 0.7) use Thrift's framed transport, so you should wrap your TSocket in a TFramedTransport. On 0.6 and earlier you should have been wrapping with a TBufferedTransport for  better performance but the framed transport is inherently buffered.


On Sep 19, 2010, at 4:31 PM, Morten Wegelbye Nissen <mw...@monit.dk> wrote:

> Hello List,
> 
> Knowing this question might be more in the area of thrift then cassandra, here goes:
> 
> I have been trying to do some research in using cassandra as backend for a system build for .net, but for some reason my client seams to terminat no matter what I do.
> 
> I am using latest from trunk, using the CliClient everything seams to work, I can insert and get data.
> 
> What I have done so far, I have noticed that the thrift.jar is build from r959516 of the thrift project - so I have fetched that from the thrift project.
> I have used the thrift.exe to generate the source from cassandra.thrift.
> Boiled it together in a C# project, and start to run it.
> But, as soon as I issue the first RPC command, a IOException( Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ) i thrown.
> 
> I have used netcat to setup a "fake" cassandra server to ensure that it is nothing to do with firewall or network issues. And here I see data.
> 
> The code to I use is:
> TTransport transport = new TSocket("192.168.0.103", 9160);
> TProtocol protocol = new TBinaryProtocol(transport);
> transport.Open();
> Cassandra.Client client = new Cassandra.Client(protocol);
> Dictionary<string,string> auth = new Dictionary<string,string>( );
> auth.Add( "dilbert", "nomoovertime" );
> AuthenticationRequest ar = new AuthenticationRequest();
> ar.Credentials = auth;
> client.send_login( ar );
> 
> Any clues, help, directions would be really appreciated,
> Morten
>