【问题标题】:rpc_timeout for a simple query on cassandra, using an indexrpc_timeout 用于对 cassandra 的简单查询,使用索引
【发布时间】:2014-01-08 18:54:41
【问题描述】:

这里是模型,使用cassandra 2.0,cql 3,只有一个节点:

CREATE TABLE purchase (
  row_id timeuuid,
  date text,
  domain_id text,
  item_id text,
  product_id text,
  purchase_id text,
  stream_id text,
  PRIMARY KEY (row_id)
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  index_interval=128 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  default_time_to_live=0 AND
  speculative_retry='99.0PERCENTILE' AND
  memtable_flush_period_in_ms=0 AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'LZ4Compressor'};

CREATE INDEX purchase_date ON purchase (date);

CREATE INDEX purchase_domain ON purchase (domain_id);

domain_id 的所有值都是一样的,所以在这个字段上查询应该没有问题。但我有这个:

cqlsh:mykeyspace> select count(*) from purchase limit 1000000;

 count
--------
 114292

所以这不是一张沉重的桌子,而是:

cqlsh:mykeyspace> select * from purchase where domain_id = 'test' limit 5;

 row_id                               | date       | domain_id | item_id   | product_id | purchase_id | stream_id
--------------------------------------+------------+-----------+-----------+------------+-------------+-----------
 090006e0-788f-11e3-a0c1-6142bbb646b5 | 2014-01-01 |     test | 254386500 |   6567576457 |   7654546343 |  purchase
 eb6300b0-788e-11e3-a0c1-6142bbb646b5 | 2014-01-01 |     test | 254386500 |   6567576457 |   7654546343 |  purchase
 fc268980-788e-11e3-a0c1-6142bbb646b5 | 2014-01-01 |     test | 254386500 |   6567576457 |   7654546343 |  purchase
 1fdefe40-7888-11e3-a0c1-6142bbb646b5 | 2014-01-01 |     test | 254386500 |   6567576457 |   7654546343 |  purchase
 f7cc3010-788e-11e3-a0c1-6142bbb646b5 | 2014-01-01 |     test | 254386500 |   6567576457 |   7654546343 |  purchase

 cqlsh:mykeyspace> select count(*) from purchase where domain_id = 'test' limit 1000;

 count
-------
  1000

cqlsh:mykeyspace> select count(*) from purchase where domain_id = 'test' limit 10000;
Request did not complete within rpc_timeout.

看来模型是正确的,所以我想知道我做错了什么。

【问题讨论】:

  • 我建议您启用跟踪并在此处添加跟踪输出;您可以使用 TRACING ON 启用跟踪;

标签: indexing timeout cassandra secondary-indexes


【解决方案1】:

您是否尝试过使用rebuild_index nodetool 命令重建索引并在完成后重试?

【讨论】:

    猜你喜欢
    • 2013-12-31
    • 1970-01-01
    • 2017-09-07
    • 1970-01-01
    • 2012-04-26
    • 1970-01-01
    • 1970-01-01
    • 2015-09-15
    • 1970-01-01
    相关资源
    最近更新 更多