I Recently started learning cassandra and going through online tutorials for cassandra with DataStax Java Drivers. I am simply trying to connect a localhost node on my laptop.
Setup Details -
OS - Windows 7
Cassandra Version - Cassandra version: 2.1-SNAPSHOT
DataStax java driver version - 3.1.0
I could able to connect to local node by using CQLSH and cassandra-cli clients. I can also see the default keyspace system and system_traces. Below is the cassandra server log
INFO 12:12:51 Node localhost/127.0.0.1 state jump to normal
INFO 12:12:51 Startup completed! Now serving reads.
INFO 12:12:51 Starting listening for CQL clients on /0.0.0.0:9042...
INFO 12:12:51 Binding thrift service to /0.0.0.0:9160
INFO 12:12:51 Using TFramedTransport with a max frame size of 15728640 bytes.
INFO 12:12:51 Using synchronous/threadpool thrift server on 0.0.0.0 : 9160
INFO 12:12:51 Listening for thrift clients...
I am trying below simple code -
Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").build();
Metadata metadata = cluster.getMetadata();
This code throws below exception - Part of the Trace
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured columnfamily schema_usertypes))
at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:233)
I have been through all the previously asked question. Most of answers suggests changing the configuration in cassandra.yaml file.
My cassandra.yaml configuration is -
start_native_transport: true
native_transport_port: 9042
listen_address: localhost
rpc_address: 0.0.0.0
rpc_port: 9160
Most of the answers suggests to use actual IP address of machine at rpc_address, which I tried but did not worked.
Here are the Questions I been through - Question One, Question two ,Question three, Topic ,Connection requirement, Question four.
This page lists compatibility of Java DataStax drivers with cassandra versions, so I changed the driver version to 2.1.1 (As I am using cassandra 2.1), but it did not worked.
Please suggest what could be wrong.