我的问题与在 Cassandra 中运行的查询日志有关。 我有一个 Cassandra 集群。现在,如果我对它运行任何查询,如果需要大量时间(比如 1 小时)才能完全执行,那么有什么方法可以跟踪查询的状态,而且无需使用任何 cassandra API。
关于此,我发现我们可以打开“跟踪”;在 Cassandra-cli 中,然后如果我运行任何查询,我将获得查询的正确分步状态。
例如:
**cqlsh> use demo;
cqlsh:demo> CREATE TABLE test ( a int PRIMARY KEY, b text );
cqlsh:demo> tracing on;
Now tracing requests.
cqlsh:demo> INSERT INTO test (a, b) VALUES (1, 'example');
Unable to complete request: one or more nodes were unavailable.
Tracing session: 4dc5f950-6625-11e3-841a-b7e2b08eed3e
activity | timestamp | source | source_elapsed
--------------------------------------------------------+--------------+----------------+----------------
execute_cql3_query | 13:10:15,627 | 192.168.171.87 | 0
Parsing INSERT INTO test (a, b) VALUES (1, 'example'); | 13:10:15,640 | 192.168.171.87 | 13770
Preparing statement | 13:10:15,657 | 192.168.171.87 | 30090
Determining replicas for mutation | 13:10:15,669 | 192.168.171.87 | 42689
Unavailable | 13:10:15,682 | 192.168.171.87 | 55131
Request complete | 13:10:15,682 | 192.168.171.87 | 55303**
但它不能满足我的要求,因为我需要查看任何先前运行的查询的状态。
请提供任何解决方案。
谢谢 紫罗兰
最佳答案
查看 system_traces 键空间事件和 session 表。
关于cassandra - 查询日志存储在 Cassandra 中的什么位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20605968/