停止Cassandra物化视图构建 [英] Stop Cassandra Materialized View Build

查看:575
本文介绍了停止Cassandra物化视图构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法停止在Cassandra(3.7)的物化视图的构建?

Is there any way to stop the build of a materialized view in Cassandra (3.7)?

背景:我创建了两个实例化视图 A B (完全公开 - 我可能已尝试删除在构建完成之前),并且这些视图似乎永远卡住...任何尝试在同一个表上创建另一个视图 C 似乎挂起。使用nodetool

Background: I created two materialized views A and B (full disclosure - I may have attempted to drop them before the build was complete) and those views seem to be perpetually stuck...any attempt to create another view C on the same table seems to hang. Using nodetool

nodetool.viewbuildstatus <keyspace>.<view>

显示 A B的STARTED和UNKNOWN组合,并在 C 中查看STARTED。使用cql:

shows a combination of STARTED and UNKNOWN for A and B, and STARTED for views in C. Using cql:

select * from system.views_builds_in_progress

列出所有资料检视,但在过去24小时内,世代号码 last_token 对于 A ,em>实际上为空)。

all views are listed, but generation number and last_token have not changed in the last 24hrs (generation_number is in fact null for A).

推荐答案

它没有记录,但 nodetool stop 实际上采取任何压缩类型,而不仅仅是列出的(视图构建是其中之一)。所以你可以简单:

Its not documented, but nodetool stop actually takes any compaction type, not just the ones listed (which the view build is one of). So you can simply:

nodetool stop VIEW_BUILD

或者你可以直接使用 org.apache.cassandra.db:type = CompactionManager mbean的 stopCompaction 操作。

Or you can hit JMX directly with the org.apache.cassandra.db:type=CompactionManager mbean's stopCompaction operation.

所有这些都设置为视图生成器在下一个循环停止的标志。如果它抛出一个未捕获的异常或某事,所以它不再做任何事情(值得检查系统/输出日志),停止不会做任何事情。在这种情况下,它不会真正伤害任何东西,所以可以忽略它,并重试。最坏情况下重新启动节点。

All thats really gonna do is set a flag for the view builder to stop on its next loop. If it threw an uncaught exception or something so its no longer doing anything (worth checking system/output logs) the stop wont do anything either. In that case its not really hurting anything though so can ignore it and retry. Worst case restart the node.

这篇关于停止Cassandra物化视图构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆