Membase Replicas

54 views
Skip to first unread message

mike

unread,
Mar 28, 2012, 4:17:16 AM3/28/12
to membase
Is there an easy way to increase the number of membase replicas?

On my cluster now, the "Number of replica (backup)
copies" is set to 1, and it is greyed-out, unchangable. I want to
add more nodes and increase the number replicas.

Thank you.

Aliaksey Kandratsenka

unread,
Mar 28, 2012, 2:35:50 PM3/28/12
to mem...@googlegroups.com
It's not built in, but there's /diag/eval snippet that does it:

wget -O- -q --user=Administrator --password=asdads --post-data="KV = ns_config:get_kv_list(), KV2 = lists:keydelete(vbucket_map_history, 1, KV), ns_config:cas_config(KV, KV2), KV2." http://lh:9000/diag/evalroot@beta:~/src/altoros/moxi/ns_server# wget -O- --user=Administrator --password=asdasd --post-data='{ok, Config} = ns_bucket:get_bucket("default"), Map = [lists:sublist(Chain ++ [undefined,undefined], 3) || Chain <- proplists:get_value(map, Config)], ns_bucket:update_bucket_props("default", [{map, Map}, {num_replicas, 2}]).' http://lh:9000/diag/eval

make sure to replace lh:9000 with your host/port and admin name and password. Bucket name is default. You can replace it as well. Magic constant 3 is number of replicas + 1 and magic constant 2 is number of replicas.

After that snippet is run, wait 10 seconds (that's janitor runs period). On UI in server's page you'll see Rebalance button enabled. Hit rebalance and it'll actually populate those extra replicas.

Use it on your own risk. I've found it to work and we've used it once in production to decrease number of replicas and that worked well.

Chad Kouse

unread,
Mar 30, 2012, 12:56:43 PM3/30/12
to mem...@googlegroups.com
Thanks for this tip.  Is there a plan to include this as a supported function in the UI any time?  With what little I know about the guts of couchbase it seems like this isn't much of a stretch for a rebalance operation to be able to handle it.

--chad

Aliaksey Kandratsenka

unread,
Mar 30, 2012, 1:20:50 PM3/30/12
to mem...@googlegroups.com
On Fri, Mar 30, 2012 at 09:56, Chad Kouse <chad....@gmail.com> wrote:
Thanks for this tip.  Is there a plan to include this as a supported function in the UI any time?  With what little I know about the guts of couchbase it seems like this isn't much of a stretch for a rebalance operation to be able to handle it.

No plans for now. As you can easily guess we're fully focused on getting 2.0 stuff out as soon as possible.

There's a nice 'addon framework' though for all kinds of UI goodies. Here: https://github.com/alk/membase-vbucket-vis

Basically anybody can relatively easily implement js bookmarklet that'll inject any additional UI functionality that's desirable.

Reply all
Reply to author
Forward
0 new messages