could not connect to cassandra using the latest cql driver and default settings? -
i using latest version of cassandra 3.0.2 , latest version of datastax cassandra core java driver 3.0.0. settings in cassandra.yaml remains unchanged. have not changed file. whatever default settings remain same. keep hearing rpc_address should 0.0.0.0 default localhost , broadcast_rpc_address default commmented out value 1.2.3.4 (again default commented out). have not changed of default settings cassandra.yaml file remains unchanged. don't understand why need set rpc_address , after hear latest version of cassandra had moved away rpc?!
here snippet of code
cluster cassandra = cluster.builder().addcontactpoint("localhost").withport(9042).build(); listenablefuture<session> session = cassandra.connectasync("demo1"); ......
here error when turn on debug flag
com.datastax.driver.new_node_delay_seconds undefined, using default value 1 com.datastax.driver.non_blocking_executor_size undefined, using default value 8 com.datastax.driver.notif_lock_timeout_seconds undefined, using default value 60 starting new cluster contact points [localhost/127.0.0.1:9042, localhost/0:0:0:0:0:0:0:1:9042] log4j:warn no appenders found logger (io.netty.util.internal.logging.internalloggerfactory). log4j:warn please initialize log4j system properly. log4j:warn see http://logging.apache.org/log4j/1.2/faq.html#noconfig more info. com.datastax.driver.force_nio undefined, using default value false did not find netty's native epoll transport in classpath, defaulting nio. [localhost/127.0.0.1:9042] preparing open 1 new connections, total = 1 com.datastax.driver.disable_coalescing undefined, using default value false connection[localhost/127.0.0.1:9042-1, inflight=0, closed=false] connection established, initializing transport [localhost/127.0.0.1:9042] connection[localhost/127.0.0.1:9042-1, inflight=0, closed=false] transport initialized, connection ready [control connection] refreshing node list , token map listed localhost/0:0:0:0:0:0:0:1:9042 in contact points, wasn't found in control host's system.peers @ startup [control connection] refreshing schema [control connection] refreshing node list , token map [control connection] established localhost/127.0.0.1:9042 using data-center name 'datacenter1' dcawareroundrobinpolicy (if incorrect, please provide correct datacenter name dcawareroundrobinpolicy constructor) new cassandra host localhost/127.0.0.1:9042 added [localhost/127.0.0.1:9042] preparing open 1 new connections, total = 2 connection[localhost/127.0.0.1:9042-2, inflight=0, closed=false] connection established, initializing transport [localhost/127.0.0.1:9042] connection[localhost/127.0.0.1:9042-2, inflight=0, closed=false] transport initialized, connection ready created connection pool host localhost/127.0.0.1:9042 (1 connections needed, 1 opened) added connection pool localhost/127.0.0.1:9042 preparing query select "hash" col1,"body" col2 demo1.ents "hash"=?; [1795897147-1] doing retry 1 query com.datastax.driver.core.statement$1@19be093f @ consistency null [1795897147-1] error querying localhost/127.0.0.1:9042 : com.datastax.driver.core.exceptions.operationtimedoutexception: [localhost/127.0.0.1] timed out waiting server response error message -> host(s) tried query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.operationtimedoutexception: [localhost/127.0.0.1] timed out waiting server response)) error cause -> com.datastax.driver.core.exceptions.nohostavailableexception: host(s) tried query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.operationtimedoutexception: [localhost/127.0.0.1] timed out waiting server response)) com.datastax.driver.core.exceptions.nohostavailableexception: host(s) tried query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.operationtimedoutexception: [localhost/127.0.0.1] timed out waiting server response)) @ com.datastax.driver.core.exceptions.nohostavailableexception.copy(nohostavailableexception.java:84) @ com.datastax.driver.core.exceptions.nohostavailableexception.copy(nohostavailableexception.java:37) @ com.datastax.driver.core.driverthrowables.propagatecause(driverthrowables.java:37) @ com.datastax.driver.core.abstractsession.prepare(abstractsession.java:98) @ com.datastax.driver.mapping.mapper.getpreparedquery(mapper.java:118) @ com.datastax.driver.mapping.mapper.getpreparedquery(mapper.java:129) @ com.datastax.driver.mapping.mapper.getquery(mapper.java:333) @ com.datastax.driver.mapping.mapper.getquery(mapper.java:325) @ com.datastax.driver.mapping.mapper.getasync(mapper.java:388)
here exeption happens in cassandra driver
stmt = session().prepare(querystring); //mapper.java public preparedstatement prepare(string query) { //abstractsession.java try { return uninterruptibles.getuninterruptibly(prepareasync(query)); } catch (executionexception e) { throw driverthrowables.propagatecause(e); } }
Comments
Post a Comment