DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

ds-steven-matison avatar image
ds-steven-matison asked ·

DS210 Error with Stress Test

First i want to pre-empt that the only search match for this error in google is a previous Closed question (reference). However, I am getting the same error with the self edited file from the exercise and the provided edited file TestProfileEdited.yaml.

Command:

cassandra-stress user profile=/home/ubuntu/labwork/TestProfileEdited.yaml ops\(insert=1,user_by_email=3\) -node ds210-node1

Error:

java.lang.IllegalArgumentException: No query defined with name user_by_email
at org.apache.cassandra.stress.StressProfile.getQuery(StressProfile.java:390)
at org.apache.cassandra.stress.settings.SettingsCommandUser$1.get(SettingsCommandUser.java:142)
at org.apache.cassandra.stress.settings.SettingsCommandUser$1.get(SettingsCommandUser.java:110)
at org.apache.cassandra.stress.operations.SampledOpDistributionFactory$1.get(SampledOpDistributionFactory.java:81)
at org.apache.cassandra.stress.StressAction$Consumer.<init>(StressAction.java:409)
at org.apache.cassandra.stress.StressAction.run(StressAction.java:233)
at org.apache.cassandra.stress.StressAction.warmup(StressAction.java:121)
at org.apache.cassandra.stress.StressAction.run(StressAction.java:70)
at org.apache.cassandra.stress.Stress.run(Stress.java:143)
at org.apache.cassandra.stress.Stress.main(Stress.java:62)

Yaml Contents:

#
# Keyspace name and create CQL
#
keyspace: killr_video
keyspace_definition: |
  CREATE KEYSPACE killr_video WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};

#
# Table name and create CQL
#
table: user_by_email
table_definition: |
  CREATE TABLE user_by_email (
    email TEXT,
    password TEXT,
    user_id UUID,
    PRIMARY KEY ((email))
  )

#
# Meta information for generating data
#
columnspec:
  - name: email
    size: gaussian(8..30)
    population: exp(1..1000000)
  - name: password
    size: exp(8..30)
    population: uniform(1..1000000)
  - name: user_id
    size: fixed(4)
    population: uniform(1..1000000)

#
# Specs for insert queries
#
insert:
  partitions: fixed(1)
  batchtype: UNLOGGED       # use unlogged batches
  select: fixed(1)/1

#
# Read queries to run against the schema
#
queries:
   get_user:
      cql: select * from user_by_email where email = ?
      fields: samerow

Can anyone help?

academyds210
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

bettina.swynnerton avatar image
bettina.swynnerton answered ·

Hi @ds-steven-matison,

You are specifying on the command line to use the query user_by_email, but it is not defined in your profile.

The two queries that are defined in your profile are insert and get_user.

I tried your profile with the following command, and it ran successfully:

cassandra-stress user profile=new_profile.yaml ops\(insert=1,get_user=3\)

Here some more info on Cassandra-Stress:

https://docs.datastax.com/en/dse/6.0/dse-admin/datastax_enterprise/tools/toolsCStress.html#toolsCStress__additional-c-stress-parameters

See here for the ops(?) option:

ops(?)
Specify what operations to run and the number of each. (only with the user option)

But these operations need to be defined in your profile, or you are getting the exception that you have been seeing.

I hope this helps you to run your stress test successfully.


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.