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

subhodip55@gmail.com avatar image
subhodip55@gmail.com asked ·

Getting IOError while running cassandra-stress for DS210

I am getting error while executing the stress test: Please help.

Here is my YAML file - (TestProfile.yaml)

==============================
# Keyspace Name
#
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..1234)
- name: password
size: exp(8..30)
population: uniform(1..1432)
- name: user_id
size: fixed(4)
population: uniform(1..1567)
#
# Specs for insert queries
#
insert:
partitions: fixed(1)
select: fixed(1)/1
batchtype: UNLOGGED # use unlogged batches

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

Error

=========

ubuntu@ds210-node2:~/labwork$ cassandra-stress user profile=/home/ubuntu/labwork/TestProfile.yaml ops\(insert=4,user_by_email=4\) -node ds210-node1
java.io.IOError: while parsing a block mapping
in 'reader', line 4, column 1:
keyspace: killr_video
^
expected <block end>, but found FlowEntry
in 'reader', line 6, column 75:
... on = {'class': 'SimpleStrategy' , 'replication_factor': '1'};
^
at org.apache.cassandra.stress.StressProfile.load(StressProfile.java:857)
at org.apache.cassandra.stress.settings.SettingsCommandUser.<init>(SettingsCommandUser.java:78)
at org.apache.cassandra.stress.settings.SettingsCommandUser.build(SettingsCommandUser.java:193)
at org.apache.cassandra.stress.settings.SettingsCommand.get(SettingsCommand.java:220)
at org.apache.cassandra.stress.settings.StressSettings.get(StressSettings.java:192)
at org.apache.cassandra.stress.settings.StressSettings.parse(StressSettings.java:169)
at org.apache.cassandra.stress.Stress.run(Stress.java:80)
at org.apache.cassandra.stress.Stress.main(Stress.java:62)
Caused by: while parsing a block mapping
in 'reader', line 4, column 1:
keyspace: killr_video
^
expected <block end>, but found FlowEntry
in 'reader', line 6, column 75:
... on = {'class': 'SimpleStrategy' , 'replication_factor': '1'};
^
at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:570)
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:143)
at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:224)
at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:155)
at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122)
at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:120)
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:450)
at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:444)
at org.apache.cassandra.stress.StressProfile.load(StressProfile.java:847)
... 7 moreubuntu@ds210-node2:~/labwork$ nodetool status

Here are few other o/p from Node 1 and Node 2
ubuntu@ds210-node2:~/labwork$ nodetool status
nodetool: Failed to connect to '127.0.0.1:7199' - ConnectException: 'Connection refused (Connection refused)'.ubuntu@ds210-node2:~/labwork$ systemctl cassandra status
ERROR:systemctl:Unknown operation cassandra.

Comment: I have installed Cassandra here, but didn't start the service and also, didn't modify the YAML configuration file.

ubuntu@ds210-node1:~$ nodetool status
Datacenter: dc1
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving/Stopped
-- Address Load Tokens Owns (effective) Host ID Rack
UN 172.18.0.2 152.41 KiB 8 100.0% 8a313539-9497-44dc-b4f4-8070c0b4418b rack1
ubuntu@ds210-node1:~$ systemctl cassandra status
ERROR:systemctl:Unknown operation cassandra.

ds210
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 ·

As the error states, the YAML parser had an issue with line 6 column 75:

...
Caused by: while parsing a block mapping
in 'reader', line 4, column 1:
keyspace: killr_video
^
expected <block end>, but found FlowEntry
in 'reader', line 6, column 75:
... on = {'class': 'SimpleStrategy' , 'replication_factor': '1'};
^

In column 75, it looks like you added a "space" before the comma (,) and that made your YAML invalid.

If you're not familiar with YAMLs, I recommend you do a search for online YAML parsers so you can verify that your configuration is valid. Cheers!

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.