0

I'm trying to run cassandra-strees with defined own .yaml file but I'm still gettin an error :

java.io.IOError: java.io.FileNotFoundException: /home/kenik/Documents/stress.yaml (No such file or directory)

Which is very troublesome for me. Let's me explain why.

First of all my stress.yaml file :

# Keyspace name and create CQL
#

CREATE KEYSPACE weatherteller
WITH REPLICATION = { 
    'class' : 'SimpleStrategy',
    'datacenter1' : 1
};
#
# Table name and create CQL
#
table: weather
table_definition:
  CREATE TABLE weatherteller.weather (
        weatherid bigint,
        measurementdate timestamp,
        summary varchar,
        preciptype varchar,
        temperature double,
        apparenttemperature double, 
        humidity double,
        windspeed double,
        windbearing double,
        visibility double,
        pressure double,
        dailysummary varchar,
        city varchar,
        PRIMARY KEY (weatherid, measurementdate, city)
   )
#
columnspec:
  - name: weatherid
    size: uniform(1..64)
  - name: measurementdate
    cluster: uniform(20...40)
  - name: summary
    size: gaussian(100...500)
  - name: preciptype
    size: uniform(1..32)
  - name: temperature
    size: uniform(1..32)
  - name: apparenttemperature
    size: uniform(1..32)
  - name: humidity
    size: uniform(1..10)
  - name: windspeed
    size: uniform(1..10)
  - name: windbearing
    size: uniform(1..10)
  - name: visibility
    size: uniform(1..10)
  - name: pressure
    size: uniform(1..10)  
  - name: dailysummary
    size: uniform(1..100)  
  - name: city
    size: uniform(1..100)  


insert:
  partitions: fixed(1)
  select: fixed(1)/500 
  batchtype: UNLOGGED

queries:
  weather:
    cql: select * from weather where weatherid = ? and measurementdate = ? and city = ?
    fields: samerow

Command run by me :

docker exec -it cassandra cassandra-stress user profile=file:///home/kenik/Documents/stress.yaml no-warmup ops\(insert=1,weather=1\) n=10000 -graph file=./stress.html

'cassandra' is my container which is currently running.

Absolute path to stress.yaml file is /home/kenik/Documents/stress.yaml I've checked that using command : readlink -f stress.yaml. I'm at directory where stress.yaml is placed. As you can see path seems to be fine but cassandra-stress cannot find it anyway.

Do you know any way to run this cassandra-stress test?

// UPDATE When start the container I use command :

docker run -e DS_LICENSE=accept -e CASSANDRA_CLUSTER_NAME=MyCluster -e CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch -e CASSANDRA_DC=datacenter1 -v /home/kenik/Documents/dir -p 9042:9042 --name cassandra -m 2g -d modified-cassandra

or

docker run -e DS_LICENSE=accept -e CASSANDRA_CLUSTER_NAME=MyCluster -e CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch -e CASSANDRA_DC=datacenter1 -v /home/kenik/Documents/:/dir -p 9042:9042 --name cassandra -m 2g -d modified-cassandra

And trying to execute test:

docker exec -it cassandra cassandra-stress user profile=file:///dir/stress.yaml ops\(insert=1\) n=10000 -graph file=stress.html

Result is the same : file not found exception. I've updated the post because I maght make some type or didn't understand answer properly.

kenik
  • 142
  • 3
  • 13

1 Answers1

0

You're running it via Docker, and processes from running Docker image don't have access to your file system until you mount it explicitly. You need to mount your directory into Docker when you start image, using the -v command switch of docker run, and then refer to it from the docker exec, for example:

docker run ... -v /home/kenik/Documents/:/somedir ...
docker exec ... profile=file:///somedir/stress.yaml

You can read more about volumes in Docker documentation.

Update: here is fully working solution:

docker run -v /var/tmp/123/:/data/ --name stress-test cassandra
sudo cp sales-stress-exampl.yaml /var/tmp/123
docker exec -ti stress-test cassandra-stress user \
  profile=file:///data/sales-stress-exampl.yaml \
  ops\(insert=3,read1=1\) no-warmup
Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • Hey. I've tried your way and the problem still remains. I've updated the question, please take a look. – kenik May 12 '19 at 10:29