cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ssivikt@gmail.com" <ssiv...@gmail.com>
Subject Re: Cassandra Java Driver
Date Mon, 04 Jan 2016 08:43:32 GMT
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?/

/
On 12/30/2015 04:48 PM, DuyHai Doan wrote:
>
> Check protocol version when you create your Cluster object on the 
> client side
>
> Le 30 déc. 2015 13:33, "ssivikt@gmail.com <mailto:ssivikt@gmail.com>" 
> <ssivikt@gmail.com <mailto:ssivikt@gmail.com>> a écrit :
>
>     I've just tried to use cassandra-driver-core-3.0.0_rc1 and
>     cassandra-driver-core-3.0.0_beta1 with C* 2.2.4
>     (cassandra-all-2.2.4). And neither of them can connect to the
>     local cluster. But  cassandra-driver-core-2.1.9. Am I doing wrong?
>
>
>     Happy New Year!
>
>     On 12/28/2015 04:08 PM, Alexandre Dutra wrote:
>>     FYI, Java driver 3.0.0-rc1 has just been released
>>     <https://groups.google.com/a/lists.datastax.com/d/msg/java-driver-user/779VHUOVcOM/h7fYfOyOBQAJ>.
>>
>>
>>     On Sat, Dec 26, 2015 at 11:15 AM Brice Dutheil
>>     <brice.dutheil@gmail.com <mailto:brice.dutheil@gmail.com>> wrote:
>>
>>         Not yet. The latestest DSE (4.8.3) is shipped with a patched
>>         version of Cassandra 2.11.
>>         You can find this information on their website.
>>
>>         4.8 Release note :
>>         https://docs.datastax.com/en/datastax_enterprise/4.8/datastax_enterprise/RNdse.html
>>         From this page in the menu you can navigate and unroll the
>>         menu /Product Guide/ > /Datastax Enterprise/ it should
>>         contain DSE versions.
>>
>>         And there's always other sources like the blog.
>>
>>         Cassandra 3.x should be shipped with DSE 5.x early next year.
>>
>>
>>         HTH
>>
>>         -- Brice
>>
>>         On Sat, Dec 26, 2015 at 3:46 AM, Noorul Islam Kamal Malmiyoda
>>         <noorul@noorul.com <mailto:noorul@noorul.com>> wrote:
>>
>>             Is DSE shipping with 3.x ?
>>
>>             Thanks and Regards
>>             Noorul
>>
>>             On Fri, Dec 25, 2015 at 9:07 PM, Alexandre Dutra
>>             <alexandre.dutra@datastax.com
>>             <mailto:alexandre.dutra@datastax.com>> wrote:
>>             > Hi Jean,
>>             >
>>             > You should use 3.0.0-beta1.
>>             >
>>             > TL;DR
>>             >
>>             > DataStax Java driver series 2.2.x has been discontinued
>>             in favor of series
>>             > 3.x; we explained why in this mail to the Java driver
>>             mailing list. We do
>>             > not advise users to use this series.
>>             >
>>             > So the most recent driver version compatible with all
>>             versions of Cassandra,
>>             > including 2.2 and 3.x, is now 3.0.0-beta1, although
>>             3.0.0-rc1 will be
>>             > released very soon.
>>             >
>>             > In spite of its "beta" label, version 3.0.0-beta1 has
>>             been thoroughly tested
>>             > against all versions of Cassandra and is definitely
>>             production-ready... as
>>             > long as the Cassandra version in use is also
>>             production-ready. Note however
>>             > that Cassandra 2.2 and 3.0 are quite recent and most
>>             companies AFAICT do not
>>             > consider them yet as production-ready.
>>             >
>>             > Hope that helps,
>>             >
>>             > Alexandre
>>             >
>>             >
>>             > On Tue, Dec 22, 2015 at 4:40 PM Jean Tremblay
>>             > <jean.tremblay@zen-innovations.com
>>             <mailto:jean.tremblay@zen-innovations.com>> wrote:
>>             >>
>>             >> Hi,
>>             >> Which Java Driver is suited for Cassandra 2.2.x. ?
>>             >> I see datastax 3.0.0 beta1 and datastax 2.2.0 rc3...
>>             >> Are they suited for production?
>>             >> Is there anything better?
>>             >> Thanks for your comments and replies?
>>             >> Jean
>>             >
>>             > --
>>             > Alexandre Dutra
>>             > Driver & Tools Engineer @ DataStax
>>
>>
>>     -- 
>>     Alexandre Dutra
>>     Driver & Tools Engineer @ DataStax
>
>     -- 
>     Thanks,
>     Serj
>

-- 
Thanks,
Serj


Mime
View raw message