cassandra-stress:无法在maybeLoadschemainfo(StressProfile.java)中找到表<keyspace name =“”>。<tablename>

时间:2017-08-27 22:19:34

标签: cassandra-3.0 cassandra-stress-tool

配置: -

3节点集群

节点1 - &gt; 172.27.21.16(种子节点)

节点2 - &gt; 172.27.21.18

节点3 - &gt; 172.27.21.19

所有节点的

cassandra.yaml参数: -

1)种子:&#34; 172.27.21.16&#34;

2)write_request_timeout_in_ms:5000

3)listen_address:172.27.21.1(6,8,9)

4)rpc_address:172.27.21.1(6,8,9)

这是我的code.yaml文件: -

    keyspace: prutorStress3node
    keyspace_definition: |
  CREATE KEYSPACE prutorStress3node WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 2};


table: code

table_definition: |
  CREATE TABLE code (
        id timeuuid,
        assignment_id bigint,
        user_id text,
        contents text,
        save_type smallint,
        save_time timeuuid,
        PRIMARY KEY(assignment_id, id)
  ) WITH CLUSTERING ORDER BY (id DESC)


columnspec:
  - name: assignment_id
    population: uniform(1..100000)  # Assignment IDs from range 1-100000

  - name: id
    cluster: fixed(100)             # Each assignment id will have atmost 100 ids(maximum 100 codes                 allowed per student)

  - name: user_id
    size: fixed(50)                 # user_id comes from account table varchar(50)

  - name: contents
    size: uniform(1..2000)

  - name: save_type
    size: fixed(1)                  # Generated values between 1 to 4
    population: uniform(1..4)

  - name: save_time


insert:
  partitions: fixed(1)            # The number of partitions to update per batch

  select:    fixed(1)/100         # The ratio of rows each partition should insert as a proportion of the total possible rows for the partition (as defined by the clustering distribution columns

  batchtype: UNLOGGED             # The type of CQL batch to use. Either LOGGED/UNLOGGED

queries:
   query1:
      cql: select id,contents,save_type,save_time from code where assignment_id = ?
      fields: samerow
   query2: 
      cql: select id,contents,save_type,save_time from code where assignment_id = ? LIMIT 10
      fields: samerow
   query3:
      cql: SELECT contents FROM code WHERE id = ?   # Create index for this query
      fields: samerow

以下是我从172.27.21.17运行的脚本(同一网络上但在不同群集中的节点): -

#!/bin/bash

echo '***********************************'
echo Deleting old data from prutorStress3node
echo '***********************************'

cqlsh -e "DROP KEYSPACE prutorStress3node" 172.27.21.16
sleep 120

echo '***********************************'
echo Creating fresh data
echo '***********************************'

/bin/cassandra-stress user profile=./code.yaml n=1000000 no-warmup cl=quorum ops\(insert=1\) \
-rate threads=25 -node 172.27.21.16
sleep 120

问题: - 问题是当我在删除以前的数据之后运行脚本并且在启动这些节点之后,它运行正常,但是当我进一步运行它时,对于每次运行,我都会遇到以下错误: -

Unable to find prutorStress3node.code
at org.apache.cassandra.stress.StressProfile.maybeLoadSchemaInfo(StressProfile.java:306)
    at org.apache.cassandra.stress.StressProfile.maybeCreateSchema(StressProfile.java:273)
    at org.apache.cassandra.stress.StressProfile.newGenerator(StressProfile.java:676)
    at org.apache.cassandra.stress.StressProfile.printSettings(StressProfile.java:129)
    at org.apache.cassandra.stress.settings.StressSettings.printSettings(StressSettings.java:383)
    at org.apache.cassandra.stress.Stress.run(Stress.java:95)
    at org.apache.cassandra.stress.Stress.main(Stress.java:62)

在StressProfile.java文件中,我看到表元数据正在填充为NULL。我试图理解堆栈跟踪,但是无法做出任何改进。请告诉我一些可能出错的方向?

1 个答案:

答案 0 :(得分:0)

以小写字母给出键空间和表名解决了我的问题。以前我给的是混合案例,我也遇到了同样的错误。