MB-7562 Grab per node diags sequentially.

So that peak memory usage is lesser. This commit is only a
preparation. In reality we don't want to grab all diags completely
sequentially because then the overall time will be very sensitive to
slowness on individual nodes.

Change-Id: I0cec1478a54d9ed40c7bdaadc062b547510af8bd
Reviewed-on: http://review.couchbase.org/24456
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7562 Process processes info one by one when formatting diag.

Erlang's pretty-printer is known memory hog and number of processes
may be quite noticeable. So it makes sense to format every process
info separately.

Change-Id: I7138c2fc43a3897d50da1a3b137644e0f185d172
Reviewed-on: http://review.couchbase.org/24457
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7562 Format master activity events separately.

There're basically two reasons for these. As with processes, number of
events maybe quite big which causes pretty printer to consume a lot of
memory. The other reason is that we already have a better way to
format these messages. Namely, master_activity_events:event_to_jsons.

Change-Id: Ic4587273004130d28f094c892230e238a78c16cc
Reviewed-on: http://review.couchbase.org/24458
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7562 Send per node diag in binary format.

This requires much less memory. We convert specific node's diag to
term just before the formatting and perform explicit garbage
collection afterwards to save space.

Change-Id: I5024f8b4cfcf45ab45c1b75ad0949ffc289a4406
Reviewed-on: http://review.couchbase.org/24459
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7706 Delete _replicator db when joining cluster.

Change-Id: I67016cfd5cd2d6829505f30005a0268a12d39f11
Reviewed-on: http://review.couchbase.org/24515
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>