Discussion:
Cassandra-Java-Driver and C* v3.* -- failed to connect
s***@gmail.com
2016-01-05 04:51:16 UTC
Permalink
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
Alex Popescu
2016-01-05 08:57:32 UTC
Permalink
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.
Post by s***@gmail.com
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/.
/<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>/
/Cluster.Builder builder = Cluster.builder()
.withProtocolVersion(ProtocolVersion.V4)
.withPort(9042)
.addContactPoint("127.0.0.1");
cluster = builder.build();
Metadata metadata = cluster.getMetadata();/
/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
s***@gmail.com
2016-01-05 09:06:06 UTC
Permalink
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.
Post by Alex Popescu
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.
Post by s***@gmail.com
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/.
/<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>/
/Cluster.Builder builder = Cluster.builder()
.withProtocolVersion(ProtocolVersion.V4)
.withPort(9042)
.addContactPoint("127.0.0.1");
cluster = builder.build();
Metadata metadata = cluster.getMetadata();/
/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
Alex Popescu
2016-01-05 09:28:52 UTC
Permalink
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
Post by s***@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.
Post by Alex Popescu
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.
Hi All,
Post by s***@gmail.com
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/.
/<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>/
/Cluster.Builder builder = Cluster.builder()
.withProtocolVersion(ProtocolVersion.V4)
.withPort(9042)
.addContactPoint("127.0.0.1");
cluster = builder.build();
Metadata metadata = cluster.getMetadata();/
/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
s***@gmail.com
2016-01-05 12:48:33 UTC
Permalink
Yes, I've tried 3.0.0-rc1. It can not connect to the cluster v3.1.1
Post by Alex Popescu
Serj, there have been an RC recently which should give you a stable API and
https://groups.google.com/a/lists.datastax.com/d/msg/java-driver-user/779VHUOVcOM/h7fYfOyOBQAJ
Post by s***@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.
Post by Alex Popescu
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.
Hi All,
Post by s***@gmail.com
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/.
/<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>/
/Cluster.Builder builder = Cluster.builder()
.withProtocolVersion(ProtocolVersion.V4)
.withPort(9042)
.addContactPoint("127.0.0.1");
cluster = builder.build();
Metadata metadata = cluster.getMetadata();/
/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
Loading...