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: /// //com.datastax.cassandra// //cassandra-driver-core// //3.0.0-rc1// // //org.apache.cassandra// //cassandra-all// //3.1.1// /// 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]/ /// //com.datastax.cassandra// //cassandra-driver-core// //2.1.9// // //org.apache.cassandra// //cassandra-all// //3.1.1// /// /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
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, ssiv...@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: /// //com.datastax.cassandra// //cassandra-driver-core// //3.0.0-rc1// // //org.apache.cassandra// //cassandra-all// //3.1.1// /// 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]/ /// //com.datastax.cassandra// //cassandra-driver-core// //2.1.9// // //org.apache.cassandra// //cassandra-all// //3.1.1// /// /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
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, ssiv...@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, ssiv...@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: /// //com.datastax.cassandra// //cassandra-driver-core// //3.0.0-rc1// // //org.apache.cassandra// //cassandra-all// //3.1.1// /// 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]/ /// //com.datastax.cassandra// //cassandra-driver-core// //2.1.9// // //org.apache.cassandra// //cassandra-all// //3.1.1// /// /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