如何在Riak中停用或删除存储桶类型?

Kho*_*rak 7 riak

/home/khorkak> sudo riak-admin bucket-type
Usage: riak-admin bucket-type <command>

The follow commands can be used to manage bucket types for the cluster:

   list                           List all bucket types and their activation status
   status <type>                  Display the status and properties of a type
   activate <type>                Activate a type
   create <type> <json>           Create or modify a type before activation
   update <type> <json>           Update a type after activation
/home/khorkak>
Run Code Online (Sandbox Code Playgroud)

好吧,我在尝试一些我不再需要的东西时创建了一组桶类型 - 我可以在不重新安装Riak的情况下摆脱这些吗?

小智 7

遗憾的是,目前Riak中没有任何记录方法可以删除未使用的存储桶类型.

如果您不介意删除Riak中的所有数据,可以停止Riak,删除数据目录的内容,然后重新启动Riak.(如果您有多个节点,则需要在重新启动节点之前停止每个节点并删除每个节点上的数据目录.)

如果只删除Bitcask或LevelDB数据目录中的数据,则桶类型元数据仍将存在于环中.

  • 谢谢我现在可以轻松地重新加载我的数据所以我会试一试.如果我已经有很多数据要处理,那会很烦人 - 似乎应该更好地处理一些事情. (3认同)
  • riak_core_bucket模块中有一个重置函数,它将用墓碑替换桶类型的详细信息,但这是我最接近删除的内容.来自riak_core_metadata模块的评论:"%%注意:当前删除是合乎逻辑的,不执行GC." 我会假设逻辑删除的桶类型将不再可用,但至少名称将保留在环中. (3认同)