datastax-java-driver

Can't connect to cassandra - NoHostAvailableException

梦想与她 提交于 2019-11-27 15:01:05
I know there are several threads about the NoHostAvailableException but they simply don't provide a solution to my problem. I can't connect to Cassandra with the Datastax Java Cassandra Driver. I get the Error: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: [/54.221.241.107]) I am sure that the configuration is correct. I've set the configuration in cassandra.yaml: start_native_transport: true # port for the CQL native transport to listen for clients on native_transport_port: 9042 My Cassandra installation is a standard installation on

Re-using PreparedStatement when using Datastax Cassandra Driver?

 ̄綄美尐妖づ 提交于 2019-11-27 06:40:34
问题 I'm currently using the Datastax Cassandra driver for Cassandra 2 to execute cql3. This works correctly. I started using PreparedStatement's : Session session = sessionProvider.getSession(); try { PreparedStatement ps = session.prepare(cql); ResultSet rs = session.execute(ps.bind(objects)); if (irsr != null) { irsr.read(rs); } } Sometimes I get a warning from the driver in my log: Re-preparing already prepared query . Please note that preparing the same query more than once is generally an

Cassandra cluster with bad insert performance and insert stability

假装没事ソ 提交于 2019-11-27 03:37:11
问题 I have to store around 250 numerical values per second, per client, which is around 900k numbers per hour. It probably will not be a full-day recording (probably between 5-10 hours a day), but I will partition my data based on the client id and the day the reading is made. The maximum row length comes at about 22-23M which is still manageable. Neverteless, my scheme looks like this: CREATE TABLE measurement ( clientid text, date text, event_time timestamp, value int, PRIMARY KEY ((clientid

Error while connecting to Cassandra using Java Driver for Apache Cassandra 1.0 from com.example.cassandra

落花浮王杯 提交于 2019-11-27 02:04:56
问题 While connecting to Cassandra client using java driver for Cannsandra by DataStax, it is throwing following error.. Exception in thread "main" com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: [/127.0.0.1]) Please suggest... Thanks! My java code is like this: package com.example.cassandra; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Host; import com.datastax.driver.core.Metadata; public class SimpleClient {