You are viewing a plain text version of this content. The canonical link for it is here.
Posted to client-dev@cassandra.apache.org by "ssivikt@gmail.com" <ss...@gmail.com> on 2016/01/05 05:51:16 UTC

Cassandra-Java-Driver and C* v3.* -- failed to connect

Hi All,
I'm trying to connect to C* v3.1.1 cluster.
It works nice with cqlsh

/$ cqlsh//
//Connected to Test Cluster at 127.0.0.1:9042.//
//[cqlsh 5.0.1 | Cassandra 3.1.1 | CQL spec 3.3.1 | Native protocol v4]/

But doesn't work with /cassandra-driver-core/.
I use next mvn deps:

/<dependency>//
//    <groupId>com.datastax.cassandra</groupId>//
//<artifactId>cassandra-driver-core</artifactId>//
//    <version>3.0.0-rc1</version>//
//</dependency>//
//
//<dependency>//
//    <groupId>org.apache.cassandra</groupId>//
//    <artifactId>cassandra-all</artifactId>//
//    <version>3.1.1</version>//
//</dependency>/

And connect in the next code:

/Cluster.Builder builder = Cluster.builder()
         .withProtocolVersion(ProtocolVersion.V4)
         .withPort(9042)
         .addContactPoint("127.0.0.1");

cluster = builder.build();
Metadata metadata = cluster.getMetadata();/

And it doesn't work. I get the exception:
/com.datastax.driver.core.exceptions.NoHostAvailableException: All 
host(s) tried for query failed (tried: /127.0.0.1:9042 
(com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] 
Cannot connect))//
//    at 
com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:231)//
//    at 
com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:77)//
//    at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1382)//
//    at com.datastax.driver.core.Cluster.getMetadata(Cluster.java:393)/

Everything is ok for C* 2.2.4 when I use
/
$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.2.4 | CQL spec 3.3.1 | Native protocol v4]/

/<dependency>//
//    <groupId>com.datastax.cassandra</groupId>//
//<artifactId>cassandra-driver-core</artifactId>//
//    <version>2.1.9</version>//
//</dependency>//
//
//<dependency>//
//    <groupId>org.apache.cassandra</groupId>//
//    <artifactId>cassandra-all</artifactId>//
//    <version>3.1.1</version>//
//</dependency>/

/Cluster.Builder builder = Cluster.builder()
         .withPort(9042)
         .addContactPoint("127.0.0.1");


/C* java driver isn't ready to use?/
/

-- 
Thanks,
Serj


Re: Cassandra-Java-Driver and C* v3.* -- failed to connect

Posted by "ssivikt@gmail.com" <ss...@gmail.com>.
Yes, I've tried 3.0.0-rc1. It can not connect to the cluster v3.1.1

On 01/05/2016 12:28 PM, Alex Popescu wrote:
> Serj, there have been an RC recently which should give you a stable API and
> the latest bug fixes:
> https://groups.google.com/a/lists.datastax.com/d/msg/java-driver-user/779VHUOVcOM/h7fYfOyOBQAJ
>
> On Tue, Jan 5, 2016 at 11:06 AM, ssivikt@gmail.com <ss...@gmail.com>
> wrote:
>
>> I've just tried cassandra-driver-core v3.0.0-alpha5 and it works with C*
>> 3.1.1. At least it connects to the cluster.
>>
>>
>> On 01/05/2016 11:57 AM, Alex Popescu wrote:
>>
>>> Hi Serj,
>>>
>>> Have you tried the 3.0 rc? Due to some changes in the system tables, the
>>> older versions of the driver do have problems connecting.
>>>
>>> On Tue, Jan 5, 2016 at 6:51 AM, ssivikt@gmail.com <ss...@gmail.com>
>>> wrote:
>>>
>>> Hi All,
>>>> I'm trying to connect to C* v3.1.1 cluster.
>>>> It works nice with cqlsh
>>>>
>>>> /$ cqlsh//
>>>> //Connected to Test Cluster at 127.0.0.1:9042.//
>>>> //[cqlsh 5.0.1 | Cassandra 3.1.1 | CQL spec 3.3.1 | Native protocol v4]/
>>>>
>>>> But doesn't work with /cassandra-driver-core/.
>>>> I use next mvn deps:
>>>>
>>>> /<dependency>//
>>>> //    <groupId>com.datastax.cassandra</groupId>//
>>>> //<artifactId>cassandra-driver-core</artifactId>//
>>>> //    <version>3.0.0-rc1</version>//
>>>> //</dependency>//
>>>> //
>>>> //<dependency>//
>>>> //    <groupId>org.apache.cassandra</groupId>//
>>>> //    <artifactId>cassandra-all</artifactId>//
>>>> //    <version>3.1.1</version>//
>>>> //</dependency>/
>>>>
>>>> And connect in the next code:
>>>>
>>>> /Cluster.Builder builder = Cluster.builder()
>>>>           .withProtocolVersion(ProtocolVersion.V4)
>>>>           .withPort(9042)
>>>>           .addContactPoint("127.0.0.1");
>>>>
>>>> cluster = builder.build();
>>>> Metadata metadata = cluster.getMetadata();/
>>>>
>>>> And it doesn't work. I get the exception:
>>>> /com.datastax.driver.core.exceptions.NoHostAvailableException: All
>>>> host(s)
>>>> tried for query failed (tried: /127.0.0.1:9042
>>>> (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1]
>>>> Cannot connect))//
>>>> //    at
>>>>
>>>> com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:231)//
>>>> //    at
>>>>
>>>> com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:77)//
>>>> //    at
>>>> com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1382)//
>>>> //    at com.datastax.driver.core.Cluster.getMetadata(Cluster.java:393)/
>>>>
>>>> Everything is ok for C* 2.2.4 when I use
>>>> /
>>>> $ cqlsh
>>>> Connected to Test Cluster at 127.0.0.1:9042.
>>>> [cqlsh 5.0.1 | Cassandra 2.2.4 | CQL spec 3.3.1 | Native protocol v4]/
>>>>
>>>> /<dependency>//
>>>> //    <groupId>com.datastax.cassandra</groupId>//
>>>> //<artifactId>cassandra-driver-core</artifactId>//
>>>> //    <version>2.1.9</version>//
>>>> //</dependency>//
>>>> //
>>>> //<dependency>//
>>>> //    <groupId>org.apache.cassandra</groupId>//
>>>> //    <artifactId>cassandra-all</artifactId>//
>>>> //    <version>3.1.1</version>//
>>>> //</dependency>/
>>>>
>>>> /Cluster.Builder builder = Cluster.builder()
>>>>           .withPort(9042)
>>>>           .addContactPoint("127.0.0.1");
>>>>
>>>>
>>>> /C* java driver isn't ready to use?/
>>>> /
>>>>
>>>> --
>>>> Thanks,
>>>> Serj
>>>>
>>>>
>>>>
>> --
>> Thanks,
>> Serj
>>
>>
>

-- 
Thanks,
Serj


Re: Cassandra-Java-Driver and C* v3.* -- failed to connect

Posted by Alex Popescu <al...@datastax.com>.
Serj, there have been an RC recently which should give you a stable API and
the latest bug fixes:
https://groups.google.com/a/lists.datastax.com/d/msg/java-driver-user/779VHUOVcOM/h7fYfOyOBQAJ

On Tue, Jan 5, 2016 at 11:06 AM, ssivikt@gmail.com <ss...@gmail.com>
wrote:

> I've just tried cassandra-driver-core v3.0.0-alpha5 and it works with C*
> 3.1.1. At least it connects to the cluster.
>
>
> On 01/05/2016 11:57 AM, Alex Popescu wrote:
>
>> Hi Serj,
>>
>> Have you tried the 3.0 rc? Due to some changes in the system tables, the
>> older versions of the driver do have problems connecting.
>>
>> On Tue, Jan 5, 2016 at 6:51 AM, ssivikt@gmail.com <ss...@gmail.com>
>> wrote:
>>
>> Hi All,
>>> I'm trying to connect to C* v3.1.1 cluster.
>>> It works nice with cqlsh
>>>
>>> /$ cqlsh//
>>> //Connected to Test Cluster at 127.0.0.1:9042.//
>>> //[cqlsh 5.0.1 | Cassandra 3.1.1 | CQL spec 3.3.1 | Native protocol v4]/
>>>
>>> But doesn't work with /cassandra-driver-core/.
>>> I use next mvn deps:
>>>
>>> /<dependency>//
>>> //    <groupId>com.datastax.cassandra</groupId>//
>>> //<artifactId>cassandra-driver-core</artifactId>//
>>> //    <version>3.0.0-rc1</version>//
>>> //</dependency>//
>>> //
>>> //<dependency>//
>>> //    <groupId>org.apache.cassandra</groupId>//
>>> //    <artifactId>cassandra-all</artifactId>//
>>> //    <version>3.1.1</version>//
>>> //</dependency>/
>>>
>>> And connect in the next code:
>>>
>>> /Cluster.Builder builder = Cluster.builder()
>>>          .withProtocolVersion(ProtocolVersion.V4)
>>>          .withPort(9042)
>>>          .addContactPoint("127.0.0.1");
>>>
>>> cluster = builder.build();
>>> Metadata metadata = cluster.getMetadata();/
>>>
>>> And it doesn't work. I get the exception:
>>> /com.datastax.driver.core.exceptions.NoHostAvailableException: All
>>> host(s)
>>> tried for query failed (tried: /127.0.0.1:9042
>>> (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1]
>>> Cannot connect))//
>>> //    at
>>>
>>> com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:231)//
>>> //    at
>>>
>>> com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:77)//
>>> //    at
>>> com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1382)//
>>> //    at com.datastax.driver.core.Cluster.getMetadata(Cluster.java:393)/
>>>
>>> Everything is ok for C* 2.2.4 when I use
>>> /
>>> $ cqlsh
>>> Connected to Test Cluster at 127.0.0.1:9042.
>>> [cqlsh 5.0.1 | Cassandra 2.2.4 | CQL spec 3.3.1 | Native protocol v4]/
>>>
>>> /<dependency>//
>>> //    <groupId>com.datastax.cassandra</groupId>//
>>> //<artifactId>cassandra-driver-core</artifactId>//
>>> //    <version>2.1.9</version>//
>>> //</dependency>//
>>> //
>>> //<dependency>//
>>> //    <groupId>org.apache.cassandra</groupId>//
>>> //    <artifactId>cassandra-all</artifactId>//
>>> //    <version>3.1.1</version>//
>>> //</dependency>/
>>>
>>> /Cluster.Builder builder = Cluster.builder()
>>>          .withPort(9042)
>>>          .addContactPoint("127.0.0.1");
>>>
>>>
>>> /C* java driver isn't ready to use?/
>>> /
>>>
>>> --
>>> Thanks,
>>> Serj
>>>
>>>
>>>
>>
> --
> Thanks,
> Serj
>
>


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax

Re: Cassandra-Java-Driver and C* v3.* -- failed to connect

Posted by "ssivikt@gmail.com" <ss...@gmail.com>.
I've just tried cassandra-driver-core v3.0.0-alpha5 and it works with C* 
3.1.1. At least it connects to the cluster.

On 01/05/2016 11:57 AM, Alex Popescu wrote:
> Hi Serj,
>
> Have you tried the 3.0 rc? Due to some changes in the system tables, the
> older versions of the driver do have problems connecting.
>
> On Tue, Jan 5, 2016 at 6:51 AM, ssivikt@gmail.com <ss...@gmail.com> wrote:
>
>> Hi All,
>> I'm trying to connect to C* v3.1.1 cluster.
>> It works nice with cqlsh
>>
>> /$ cqlsh//
>> //Connected to Test Cluster at 127.0.0.1:9042.//
>> //[cqlsh 5.0.1 | Cassandra 3.1.1 | CQL spec 3.3.1 | Native protocol v4]/
>>
>> But doesn't work with /cassandra-driver-core/.
>> I use next mvn deps:
>>
>> /<dependency>//
>> //    <groupId>com.datastax.cassandra</groupId>//
>> //<artifactId>cassandra-driver-core</artifactId>//
>> //    <version>3.0.0-rc1</version>//
>> //</dependency>//
>> //
>> //<dependency>//
>> //    <groupId>org.apache.cassandra</groupId>//
>> //    <artifactId>cassandra-all</artifactId>//
>> //    <version>3.1.1</version>//
>> //</dependency>/
>>
>> And connect in the next code:
>>
>> /Cluster.Builder builder = Cluster.builder()
>>          .withProtocolVersion(ProtocolVersion.V4)
>>          .withPort(9042)
>>          .addContactPoint("127.0.0.1");
>>
>> cluster = builder.build();
>> Metadata metadata = cluster.getMetadata();/
>>
>> And it doesn't work. I get the exception:
>> /com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s)
>> tried for query failed (tried: /127.0.0.1:9042
>> (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1]
>> Cannot connect))//
>> //    at
>> com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:231)//
>> //    at
>> com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:77)//
>> //    at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1382)//
>> //    at com.datastax.driver.core.Cluster.getMetadata(Cluster.java:393)/
>>
>> Everything is ok for C* 2.2.4 when I use
>> /
>> $ cqlsh
>> Connected to Test Cluster at 127.0.0.1:9042.
>> [cqlsh 5.0.1 | Cassandra 2.2.4 | CQL spec 3.3.1 | Native protocol v4]/
>>
>> /<dependency>//
>> //    <groupId>com.datastax.cassandra</groupId>//
>> //<artifactId>cassandra-driver-core</artifactId>//
>> //    <version>2.1.9</version>//
>> //</dependency>//
>> //
>> //<dependency>//
>> //    <groupId>org.apache.cassandra</groupId>//
>> //    <artifactId>cassandra-all</artifactId>//
>> //    <version>3.1.1</version>//
>> //</dependency>/
>>
>> /Cluster.Builder builder = Cluster.builder()
>>          .withPort(9042)
>>          .addContactPoint("127.0.0.1");
>>
>>
>> /C* java driver isn't ready to use?/
>> /
>>
>> --
>> Thanks,
>> Serj
>>
>>
>

-- 
Thanks,
Serj


Re: Cassandra-Java-Driver and C* v3.* -- failed to connect

Posted by Alex Popescu <al...@datastax.com>.
Hi Serj,

Have you tried the 3.0 rc? Due to some changes in the system tables, the
older versions of the driver do have problems connecting.

On Tue, Jan 5, 2016 at 6:51 AM, ssivikt@gmail.com <ss...@gmail.com> wrote:

> Hi All,
> I'm trying to connect to C* v3.1.1 cluster.
> It works nice with cqlsh
>
> /$ cqlsh//
> //Connected to Test Cluster at 127.0.0.1:9042.//
> //[cqlsh 5.0.1 | Cassandra 3.1.1 | CQL spec 3.3.1 | Native protocol v4]/
>
> But doesn't work with /cassandra-driver-core/.
> I use next mvn deps:
>
> /<dependency>//
> //    <groupId>com.datastax.cassandra</groupId>//
> //<artifactId>cassandra-driver-core</artifactId>//
> //    <version>3.0.0-rc1</version>//
> //</dependency>//
> //
> //<dependency>//
> //    <groupId>org.apache.cassandra</groupId>//
> //    <artifactId>cassandra-all</artifactId>//
> //    <version>3.1.1</version>//
> //</dependency>/
>
> And connect in the next code:
>
> /Cluster.Builder builder = Cluster.builder()
>         .withProtocolVersion(ProtocolVersion.V4)
>         .withPort(9042)
>         .addContactPoint("127.0.0.1");
>
> cluster = builder.build();
> Metadata metadata = cluster.getMetadata();/
>
> And it doesn't work. I get the exception:
> /com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s)
> tried for query failed (tried: /127.0.0.1:9042
> (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1]
> Cannot connect))//
> //    at
> com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:231)//
> //    at
> com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:77)//
> //    at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1382)//
> //    at com.datastax.driver.core.Cluster.getMetadata(Cluster.java:393)/
>
> Everything is ok for C* 2.2.4 when I use
> /
> $ cqlsh
> Connected to Test Cluster at 127.0.0.1:9042.
> [cqlsh 5.0.1 | Cassandra 2.2.4 | CQL spec 3.3.1 | Native protocol v4]/
>
> /<dependency>//
> //    <groupId>com.datastax.cassandra</groupId>//
> //<artifactId>cassandra-driver-core</artifactId>//
> //    <version>2.1.9</version>//
> //</dependency>//
> //
> //<dependency>//
> //    <groupId>org.apache.cassandra</groupId>//
> //    <artifactId>cassandra-all</artifactId>//
> //    <version>3.1.1</version>//
> //</dependency>/
>
> /Cluster.Builder builder = Cluster.builder()
>         .withPort(9042)
>         .addContactPoint("127.0.0.1");
>
>
> /C* java driver isn't ready to use?/
> /
>
> --
> Thanks,
> Serj
>
>


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax