Build Cloud-Native apps with Apache Cassandra

GOT QUESTIONS from the Workshop? You're in the right place! Post a question here and we'll get you answers.

Click here for Week 8 Materials and Homework.

Follow us on Eventbrite to get notified when new workshops are scheduled!


question

thinhvinguyen_193400 avatar image
thinhvinguyen_193400 asked ·

How can I run NoSQLBench against an Astra database?

Hi All,

I remember that David explained the command to run ./nb on the Astra database, with host=... username=KVUser password=...

I tried the following commands

export CLUSTERID=<MyClusterID>
~/nb run driver=cql \
--show-stacktraces \
workload=/home/here/cassandra-workshop-series/week7-Test-your-Apps/cql-iot-basic.yaml \
tag=phase.schema \
host=${CLUSTERID}-europe-west1.apps.astra.datastax.com/api/rest \
secure-connect=/home/ntv/Downloads/secure-connect-killrvideocluster.zip \
username=KVUser password=KVPassword

it failed with the following error:

... losts of lines ...

Failed to add contact point: b84ac878-c808-490b-93ea-51e6046db1b8-europe-west1.apps.astra.datastax.com/api/rest

Could you please give me the correct command.

Thank you in advance & Best regards

[EDIT]

2020-09-06 20:09:26,285 ERROR [main] i.n.e.c.ScenarioErrorHandler [ScenarioErrorHandler.java:50] Error from driver or included library: java.lang.RuntimeException: Error initializing activity 'cql-keyvalue':
Can't use addContactPoint(s) if you've already called withCloudSecureConnectBundle
java.util.concurrent.ExecutionException: java.lang.RuntimeException: Error initializing activity 'cql-keyvalue':
Can't use addContactPoint(s) if you've already called withCloudSecureConnectBundle
astranosqlbench
3 comments
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.

[Post converted to comment since it's not an "answer"]

0 Likes 0 · ·

[Post converted to comment since it's not an "answer"]

0 Likes 0 · ·

[Post converted to comment since it's not an "answer"]

0 Likes 0 · ·

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

As the error suggests, you can't specify the host parameter (cluster contact point) in NoSQLBench when you are also providing the secure connect bundle for your Astra database:

Can't use addContactPoint(s) if you've already called withCloudSecureConnectBundle

This is because the driver embedded in NoSQLBench uses the host/contact point that is included in the bundle.

For reference, here's an example that shows the correct usage:

$ nb run driver=cql \
    workload=cql-iot \
    tags=phase:schema \
    username=astra_user \
    password=astra_password \
    secureconnectbundle=/path/to/secure-connect-mydatabase.zip

Cheers!

2 comments 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.

Thank you VERY MUCH for the explanation of the error and the correct syntax. I am able to connect to my database in astra.datastax.com

, am able to run week7-Test-your-Apps/1-executing-commands by:

  • creating the baselines keyspace manually on astra CQL, because of the error "errmsg: User KVUser has no CREATE permission on <all keyspaces> or any of its parents"
  • replace CREATE KEYSPACE baselines by "SELECT now() from system.local;" in the phase:schema

, am able to create the iot table by removing the COMPRESSION and COMPACTION clauses of the CREATE TABLE, in week7-Test-your-Apps/2-grafana-metrics

, am not able to run "nb cql-iot cyclerate=100 --progress console:15s --docker-metrics", because nb inserts only 10 rows in iot table in astra

Since I suspect a restriction in the Free Astra database, I'm stopping here.

Thank you for your explanations & Best regards

[Post converted to comment since it's not an "answer"]

0 Likes 0 · ·
smadhavan avatar image smadhavan thinhvinguyen_193400 ·

@thinhvinguyen_193400, this doesn't look like an Astra restriction unless you're hitting the free tier 10GB limit already with your other data. cycles is the parameter that controls the range of values. Refer to the official documentation Quick Start Example for additional explanation.

0 Likes 0 · ·