Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

smadhavan avatar image
smadhavan asked Erick Ramirez edited

How to run cassandra-stress against an Astra DB?

I certainly understand I could leverage the-ever-powerful NoSQLBench against an Astra DB, but would be interested in knowing if anyone has done hacking to figure out how to run cassandra-stress against an Astra DB. Just tried to extract the secure connect bundle and perform something similar to below,

$ dse-6.8.7/resources/cassandra/tools/bin/cassandra-stress \
    write n=1000000 cl=LOCAL_QUORUM -rate threads=100 -mode native cql3 \
    user=astra password=CHANGE_ME \
    -node 19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com \
    -schema "replication(strategy=NetworkTopologyStrategy, dc-1=1) compression=LZ4Compressor keyspace=astra" \
    -transport "truststore=/home/mkadmin/astra-scb/trustStore.jks truststore-password=CHANGE_ME keystore=/home/mkadmin/astra-scb/identity.jks keystore-password=CHANGE_ME" -port "native=31906"

but it would only give me the following,

******************** Stress Settings ********************
Command:
  Type: write
  Count: 1,000,000
  No Warmup: false
  Consistency Level: LOCAL_QUORUM
  Target Uncertainty: not applicable
  Key Size (bytes): 10
  Counter Increment Distibution: add=fixed(1)
...
Mode:
  API: JAVA_DRIVER_NATIVE
  Connection Style: CQL_PREPARED
  CQL Version: CQL3
  Protocol Version: DSE_V2
  Username: astra
  Password: *suppressed*
  Auth Provide Class: null
  Max Pending Per Connection: 128
  Connections Per Host: 8
  Compression: NONE
Node:
  ...
Schema:
  Keyspace: astra
  Replication Strategy: org.apache.cassandra.locator.NetworkTopologyStrategy
  Replication Strategy Options: {dc-1=1}
  Table Compression: LZ4Compressor
  Table Compaction Strategy: null
  Table Compaction Strategy Options: {}
Transport:
  ...

java.lang.RuntimeException: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: 19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/34.73.23.96:30704 (com.datastax.driver.core.exceptions.TransportException: [19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/34.73.23.96:30704] Error writing), 19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/35.237.246.231:30704 (com.datastax.driver.core.exceptions.TransportException: [19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/35.237.246.231:30704] Error writing), 19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/34.75.56.197:30704 (com.datastax.driver.core.exceptions.TransportException: [19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/34.75.56.197:30704] Error writing))
  at org.apache.cassandra.stress.settings.StressSettings.getJavaDriverClient(StressSettings.java:148)
  at org.apache.cassandra.stress.settings.StressSettings.getJavaDriverClient(StressSettings.java:116)
  at org.apache.cassandra.stress.settings.SettingsSchema.createKeySpaces(SettingsSchema.java:66)
  at org.apache.cassandra.stress.settings.StressSettings.maybeCreateKeyspaces(StressSettings.java:156)
  at org.apache.cassandra.stress.StressAction.run(StressAction.java:57) at org.apache.cassandra.stress.Stress.run(Stress.java:148) at org.apache.cassandra.stress.Stress.main(Stress.java:67)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: 19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/34.73.23.96:30704 (com.datastax.driver.core.exceptions.TransportException: [19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/34.73.23.96:30704] Error writing), 19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/35.237.246.231:30704 (com.datastax.driver.core.exceptions.TransportException: [19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/35.237.246.231:30704] Error writing), 19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/34.75.56.197:30704 (com.datastax.driver.core.exceptions.TransportException: [19d85d62-2c12-485a-82ef-7156b03c525f-us-east1.db.astra.datastax.com/34.75.56.197:30704] Error writing))
  at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:259)
  at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:98)
  at com.datastax.driver.core.Cluster$Manager.negotiateProtocolVersionAndConnect(Cluster.java:1926) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1839)
  at com.datastax.driver.core.Cluster.getMetadata(Cluster.java:475) at org.apache.cassandra.stress.util.JavaDriverClient.connect(JavaDriverClient.java:180)
  at org.apache.cassandra.stress.settings.StressSettings.getJavaDriverClient(StressSettings.java:139)
  ... 6 more 
astracassandra-stress
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez edited

The TransportException indicates that there is a problem with the transport parameters you specified but you've omitted it in your post so I'm not able to validate what got passed to cassandra-stress.

I'm going to find out which parameters are required to connect to Astra and I'll update this post when I get the details. Cheers!

[UPDATE] Can you tell me which Java vendor + version you're using? We think SSL is broken in Java 8u275 with the implementation of TLSv1.3.

If you're running Java 8 update 275, try to downgrade to an earlier version pre-270 and see if that works for you.

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.