Memory backend doesn't work (with multi backend)?

Luke Bakken lbakken at
Thu Jun 23 14:05:53 EDT 2016


I think the documentation for multi backend could use some
improvement. Once you configure Riak to use the "multi" storage
backend, you must then *name* backends to be used by your bucket

Here is a configuration that you can use, that would create two
backends, one using the memory backend that is *named*
"my_memory_backend", and one using the leveldb backend that is named

In riak.conf:

storage_backend = multi
multi_backend.my_memory_backend.storage_backend = memory
multi_backend.my_leveldb_backend.storage_backend = leveldb

The following is an example of setting a leveldb-specific setting for
the "my_leveldb_backend" named backend:

multi_backend.my_leveldb_backend.leveldb.maximum_memory.percent = 70

Then, you associate your "os_cache" bucket type with
"my_memory_backend" this way:

riak-admin bucket-type create os_cache '{"props": {"write_once":
riak-admin bucket-type activate os_cache

Please let me know if this resolves your issue. You may have to remove
the content's of Riak's data and ring directories to overwrite your
old settings.

I have filed an issue in GitHub to improve the documentation for

Luke Bakken
lbakken at

On Wed, Jun 22, 2016 at 5:34 AM, Nagy, Attila <bra at> wrote:
> Hi,
> Trying to use the memory backend via multi.
> What I did:
> in riak.conf:
> storage_backend = multi
> Then creating a bucket type:
> riak-admin bucket-type create os_cache '{"props": {"write_once":
> true,"backend":"memory","n_val":2,"r":1,"w":1,"dw":1}}'
> riak-admin bucket-type activate os_cache
> Then I PUT an object:
> curl -v -XPUT -H "Content-Type: application/octet-stream"
> 'http://localhost:8098/types/os_cache/buckets/os_cache/keys/test1' -d 'test'
> Mext, I shut down all of the servers at once, leaving nothing in the
> cluster, then restarting them.
> And a new get for the above URL returns "test".
> When I set storage_backend to memory, it works as expected, after a full
> cluster stop, the bucket is empty.
> _______________________________________________
> riak-users mailing list
> riak-users at

More information about the riak-users mailing list