0
votes

I am trying to build a 3 node Cassandra cluster on Centos 6.7. I had no issues installing it and I can successfully run the cqlshell commands. However whenever I try to run the stress test as very simple testing case as:

cassandra-stress write n=10

I get this error

java.lang.RuntimeException: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.TransportException: [localhost/127.0.0.1] Cannot connect))
        at org.apache.cassandra.stress.settings.StressSettings.getJavaDriverClient(StressSettings.java:222)
        at org.apache.cassandra.stress.settings.SettingsSchema.createKeySpacesNative(SettingsSchema.java:79)
        at org.apache.cassandra.stress.settings.SettingsSchema.createKeySpaces(SettingsSchema.java:69)
        at org.apache.cassandra.stress.settings.StressSettings.maybeCreateKeyspaces(StressSettings.java:230)
        at org.apache.cassandra.stress.StressAction.run(StressAction.java:54)
        at org.apache.cassandra.stress.Stress.run(Stress.java:133)
        at org.apache.cassandra.stress.Stress.main(Stress.java:61)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.TransportException: [localhost/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:1414)
        at com.datastax.driver.core.Cluster.getMetadata(Cluster.java:393)
        at org.apache.cassandra.stress.util.JavaDriverClient.connect(JavaDriverClient.java:154)
        at org.apache.cassandra.stress.settings.StressSettings.getJavaDriverClient(StressSettings.java:213)
        ... 6 more

Both the seeds, listen_address and rpc_address have the correct addresses and I opened 9042, 7000, 7001 and 7199 ports in the firewall. So I am not entirely sure what might be the problem.

1
what does nodetool status come back with? Cassandra-stress is looking at your localhost.apesa

1 Answers

3
votes

run nodetool status

Take one of the printed IP addresses and try: cassandra-stress write n=10 -node <ip address>