How to turn off replication on ranning cluster?

100 views
Skip to first unread message

Andrey Nikishaev

unread,
Apr 25, 2012, 6:14:39 AM4/25/12
to couc...@googlegroups.com
I need to turn off replication on cluster to free RAM. How can i do it?
I tried:
couchbase-cli bucket-edit -c localhost:8091 -u user -p pass --bucket=default --bucket-replica=0 --bucket-ramsize=10000

But anything changed(

i'm using Couchbase 1.8

Aliaksey Kandratsenka

unread,
Apr 25, 2012, 11:55:18 AM4/25/12
to couc...@googlegroups.com
On Wed, Apr 25, 2012 at 03:14, Andrey Nikishaev <cre...@gmail.com> wrote:
I need to turn off replication on cluster to free RAM. How can i do it?
I tried:
couchbase-cli bucket-edit -c localhost:8091 -u user -p pass --bucket=default --bucket-replica=0 --bucket-ramsize=10000

But anything changed(

Changing replicas count via REST API or UI is not supported. But there's unsupported trick that works.

Here's what you can do:

wget -O- --user=Administrator --password=asdasd --post-data='{ok, Config} = ns_bucket:get_bucket("default"), Map = [lists:sublist(Chain ++ [undefined], 1) || Chain <- proplists:get_value(map, Config)], ns_bucket:update_bucket_props("default", [{map, Map}, {num_replicas, 0}]).' http://localhost:8091/diag/eval

After that few seconds later janitor (internal service that runs on node that's elected as master) will actually kill your replicas. But note that this guy is conservative and runs only when all nodes are healthy and warmed up.

If you're in emergency when some nodes are not healthy you will need other treatment. Just let us know.

Andrey Nikishaev

unread,
Apr 26, 2012, 9:13:05 AM4/26/12
to couc...@googlegroups.com
Thanks, i will try this)

Andrey Nikishaev

unread,
Apr 27, 2012, 7:18:46 AM4/27/12
to couc...@googlegroups.com
I made as you say and replicas gone, but memory doesn't free.

Aliaksey Kandratsenka

unread,
Apr 27, 2012, 12:23:54 PM4/27/12
to couc...@googlegroups.com


On Fri, Apr 27, 2012 at 04:18, Andrey Nikishaev <cre...@gmail.com> wrote:
I made as you say and replicas gone, but memory doesn't free.

Let's double-check. Replicas are gone because stats display 0 replica buckets and 0 replica items ?

What makes you think memory is not freed? Is that memory usage stat of couchbase or OS stats or something else ?

Aliaksey Kandratsenka

unread,
Apr 29, 2012, 3:01:15 PM4/29/12
to couc...@googlegroups.com
Also what's you reason for doing this?

Reply all
Reply to author
Forward
0 new messages