将 Riak CRDT 与 bitcask 后端一起使用
Using Riak CRDT with bitcask backend
我在配置 CRDT 存储桶类型和使用 bitcask 后端时遇到问题。我希望能够使用集合类型并保留 bitcask 到期的功能。
如果不指定后端,我可以创建和使用存储桶类型
sudo riak-admin bucket-type create sets '{"props":{"datatype":"set"}}'
但是如果我尝试在 props 中指定一个后端,每当我尝试使用该类型时,riak 似乎就会崩溃并且我会失去连接。
sudo riak-admin bucket-type create sets2 '{"props":{"datatype":"set","backend":"bitcask"}}'
这是我尝试使用桶类型时 error.log 中唯一的日志。如果有帮助,我还尝试将后端指定为 leveldb 和内存以及 bitcask,但没有成功。
2016-10-13 13:41:25.965 [error] <0.8870.0> gen_fsm <0.8870.0> in state active terminated with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346
2016-10-13 13:41:25.965 [error] <0.8870.0> CRASH REPORT Process <0.8870.0> with 1 neighbours exited with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 in gen_fsm:terminate/7 line 622
2016-10-13 13:41:25.965 [error] <0.168.0> Supervisor riak_core_vnode_sup had child undefined started with {riak_core_vnode,start_link,undefined} at <0.8870.0> exit with reason no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 in context child_terminated
2016-10-13 13:41:25.965 [error] <0.8896.0> gen_fsm <0.8896.0> in state ready terminated with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346
2016-10-13 13:41:25.965 [error] <0.8896.0> CRASH REPORT Process <0.8896.0> with 10 neighbours exited with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 in gen_fsm:terminate/7 line 622
2016-10-13 13:41:25.966 [error] <0.8897.0> Supervisor {<0.8897.0>,poolboy_sup} had child riak_core_vnode_worker started with riak_core_vnode_worker:start_link([{worker_module,riak_core_vnode_worker},{worker_args,[1370157784997721485815954530671515330927436759040,...]},...]) at undefined exit with reason no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 in context shutdown_error
2016-10-13 13:41:25.966 [error] <0.8897.0> gen_server <0.8897.0> terminated with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346
2016-10-13 13:41:25.966 [error] <0.8897.0> CRASH REPORT Process <0.8897.0> with 0 neighbours exited with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 in gen_server:terminate/6 line 744
我正在使用 Riak v2.0.7 LTS
当 Riak 找不到您在配置中为该存储桶类型定义的后端名称时,就会发生错误。使用多个后端时,创建桶类型时需要使用配置中定义的名称。
所以假设使用 riak documentation:
中的示例配置
storage_backend = multi
multi_backend.bitcask_mult.storage_backend = bitcask
要为 bitcask 创建存储桶,您应该使用 bitcask_mult 作为后端名称:
sudo riak-admin bucket-type create sets2 '{"props":{"datatype":"set","backend":"bitcask_mult"}}'
希望对您有所帮助
我在配置 CRDT 存储桶类型和使用 bitcask 后端时遇到问题。我希望能够使用集合类型并保留 bitcask 到期的功能。
如果不指定后端,我可以创建和使用存储桶类型
sudo riak-admin bucket-type create sets '{"props":{"datatype":"set"}}'
但是如果我尝试在 props 中指定一个后端,每当我尝试使用该类型时,riak 似乎就会崩溃并且我会失去连接。
sudo riak-admin bucket-type create sets2 '{"props":{"datatype":"set","backend":"bitcask"}}'
这是我尝试使用桶类型时 error.log 中唯一的日志。如果有帮助,我还尝试将后端指定为 leveldb 和内存以及 bitcask,但没有成功。
2016-10-13 13:41:25.965 [error] <0.8870.0> gen_fsm <0.8870.0> in state active terminated with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 2016-10-13 13:41:25.965 [error] <0.8870.0> CRASH REPORT Process <0.8870.0> with 1 neighbours exited with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 in gen_fsm:terminate/7 line 622 2016-10-13 13:41:25.965 [error] <0.168.0> Supervisor riak_core_vnode_sup had child undefined started with {riak_core_vnode,start_link,undefined} at <0.8870.0> exit with reason no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 in context child_terminated 2016-10-13 13:41:25.965 [error] <0.8896.0> gen_fsm <0.8896.0> in state ready terminated with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 2016-10-13 13:41:25.965 [error] <0.8896.0> CRASH REPORT Process <0.8896.0> with 10 neighbours exited with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 in gen_fsm:terminate/7 line 622 2016-10-13 13:41:25.966 [error] <0.8897.0> Supervisor {<0.8897.0>,poolboy_sup} had child riak_core_vnode_worker started with riak_core_vnode_worker:start_link([{worker_module,riak_core_vnode_worker},{worker_args,[1370157784997721485815954530671515330927436759040,...]},...]) at undefined exit with reason no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 in context shutdown_error 2016-10-13 13:41:25.966 [error] <0.8897.0> gen_server <0.8897.0> terminated with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 2016-10-13 13:41:25.966 [error] <0.8897.0> CRASH REPORT Process <0.8897.0> with 0 neighbours exited with reason: no case clause matching {riak_kv_multi_backend,undefined_backend,<<"bitcask">>} in riak_core_vnode:vnode_command/3 line 346 in gen_server:terminate/6 line 744
我正在使用 Riak v2.0.7 LTS
当 Riak 找不到您在配置中为该存储桶类型定义的后端名称时,就会发生错误。使用多个后端时,创建桶类型时需要使用配置中定义的名称。
所以假设使用 riak documentation:
中的示例配置
storage_backend = multi
multi_backend.bitcask_mult.storage_backend = bitcask
要为 bitcask 创建存储桶,您应该使用 bitcask_mult 作为后端名称:
sudo riak-admin bucket-type create sets2 '{"props":{"datatype":"set","backend":"bitcask_mult"}}'
希望对您有所帮助