# Keyspace Name
keyspace: demo1
# The CQL for creating a keyspace (optional if it already exists)
keyspace_definition: |
CREATE KEYSPACE demo1;
# Table name
table: sample_test
# The CQL for creating a table you wish to stress (optional if it already exists)
table_definition: |
CREATE TABLE sample_test (
key1 blob PRIMARY KEY,
value1 blob
)
### Column Distribution Specifications ###
columnspec:
- name: hash
size: fixed(96) #domain names are relatively short
- name: body
size: gaussian(100..300) #the body of the blog post can be long
population: uniform(1..10M) #10M possible domains to pick from
现在如何在同一键空间中定义另一个表?所有示例都讨论仅定义一个表。我还尝试像上面一样定义另一个表定义及其列规范,但随后出现以下错误“com.datastax.driver.core.exceptions.InvalidQueryException:批处理太大”
最佳答案
不幸的是你不能。压力配置文件只能包含一个table_definition
,并且只能在其中定义一个表。它甚至验证是否只有一个定义与 table
声明相匹配。您可以尝试同时运行压力工具的两个实例来获得该行为,这很不方便,但我认为这是除了编写自己的基准之外唯一可用的解决方法(这很棘手)。
关于cassandra - 如何为 cassandra-stress 配置文件定义多个表定义和多个列规范?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34889485/