0

I am exploring riak_ensemble from this repository [basho\riak_ensemble]

I am trying to find a way to store a data using this library. I've run the riak_ensemble via shell. after run application:ensure_all_started(riak_ensemble), I don't know what should I do for the next step.

Somebody told me that I can run it using a riak_ensemble_basic_backend.erl and also follow the unit test. However, I have no idea how to run it via shell. Probably anyone has experience with this library.

indi60
  • 867
  • 4
  • 17
  • 34
  • Riak backends are usually started by a riak_kv_vnode. Perhaps if you look at that code you can see how it starts ensemble? – Joe Mar 15 '16 at 07:03
  • Hi @Joe, hopefully, you're the one who create the riak_ensemble documentation. :) I've been trying to understand the riak_ensemble backend for a week. Moreover, I've tried to follow drop_write_test.erl in test folder but still unable to figure out how the backend work. – indi60 Mar 15 '16 at 08:56
  • No, I'm not quite that good. I'm also not really familiar with riak_ensemble. Browsing through that repo, it looks like every node will start out with a [supervisor](https://github.com/basho/riak_ensemble/blob/develop/src/riak_ensemble_sup.erl) and build from there. You should be able to get an orddict with `riak_ensemble_state:ensembles(riak_ensemble_manager:get_cluster_state()).` After that I would guess a [client](https://github.com/basho/riak_ensemble/blob/develop/src/riak_ensemble_client.erl) would be necessary – Joe Mar 15 '16 at 09:33
  • @Joe, from the documentation, I have to enable the cluster by `riak_ensembe_manager:enable().` after that, I would be able to run `riak_ensemble_state:ensembles(riak_ensemble_manager:get_cluster_state()).`. but I could not run the client from the shell(when I types riak_ensemble_ and tab, the client not in the list). do you have any suggestion? – indi60 Mar 15 '16 at 10:43
  • 1
    Try loading it first with `l(riak_ensemble_client).` – Joe Mar 15 '16 at 15:54
  • alright, @Joe; that's a basic erlang command to load a module. Thanks, I just know it! actually, along learning on erlang and riak_ensemble, in order to execute a module, I couldn't figure our parameters that I should parse inside the module, correlation one module to another module, etc. probably those things which made me stuck learning this library. – indi60 Mar 15 '16 at 23:16

0 Answers0