allow to initialize config by pulling it from another node

we also need to create duplicate set of node related keys for the node
we are copying config to in order for calls like search_node to
work correctly

Change-Id: Ie9d3ab6e3fcaf415ea203e0569178e50142f02e3
Reviewed-on: http://review.couchbase.org/41925
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
expose ns_server:get_babysitter_cookie

Change-Id: I1f272345e04ff52fee2652945988f40a8be654d9
Reviewed-on: http://review.couchbase.org/42244
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
initial implementation of couchdb node with the copy of config

no config replication yet

Change-Id: I934f5cd8e601cf1a830af9a96b060777748f1762
Reviewed-on: http://review.couchbase.org/41926
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
config replication from ns_server node to couchdb node

Change-Id: I05973c066c6953d9f76224f5ec1148a431b20f28
Reviewed-on: http://review.couchbase.org/41927
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
handle ns_server node rename on ns_couchdb node

Change-Id: I0212a061f9d4522a300c3cd7120679dbe0a9c14b
Reviewed-on: http://review.couchbase.org/41929
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
make sure that modules for child nodes are loaded in the same order

... as for ns_server node

Change-Id: Iec5f19c11046506d18063932e8c312a40b17e675
Reviewed-on: http://review.couchbase.org/41931
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
use http to access couchdb on handling /couchBase urls

the existing hack with passing mochi request to the couchdb web
server won't work after couchdb will be moved to different node

Change-Id: If176e18f2e33777e4b4f9bda5601bb974be137a0
Reviewed-on: http://review.couchbase.org/41933
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
move some functions unrelated to rdoc replication out of...

... xdc_rdoc_replication_srv.erl to the separate module

Change-Id: I08a0420b872ab16335e672ae07e95aaee7914698
Reviewed-on: http://review.couchbase.org/41936
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
remove all methods unrelated to documents replication

... from capi_ddoc_replication_srv

Change-Id: I046fbc05d4c6bdd535ece784fabb59cc63510937
Reviewed-on: http://review.couchbase.org/41937
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
ns_couchdb_storage - module that contains storage related functions

... that will be executed on ns_couchdb node

Change-Id: I97f884809ea9550015d0f6874d4b59239a726c69
Reviewed-on: http://review.couchbase.org/41938
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
service that will be maintaining compaction tasks on ns_server

.. node after couch_task_status will be moved to ns_couchdb node

[alk@tut.by: changed compression to compaction]

Change-Id: Ibfa95a77c19a3245706fd1161b6276f25117034d
Reviewed-on: http://review.couchbase.org/42088
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
remove calls to couchdb logger from couch_api_wrap_httpc

.. because it will be called on ns_server node which doesn't
have couchdb logger

Change-Id: Ia89af94b91ee1a80e510db004cb3c3d55353ddce
Reviewed-on: http://review.couchbase.org/42089
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
use sockets from pool for all calls to memcached from capi_replication

and capi_frontend to be able to host capi_replication and capi_frontend
on a node without ns_memcached server

Change-Id: I429b01db0e3c739bcf3272b7fd719da9bb67f74b
Reviewed-on: http://review.couchbase.org/42149
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-12335: added support for not reloading buckets on cfg change

Now if config variable dont_reload_bucket_on_cfg_change is set to
true, bucket instances on entire cluster will not be restarted on
bucket config change like bucket priority change or eviction policy
change.

Setting it can be done by posting:

ns_config:set(dont_reload_bucket_on_cfg_change, true).

to /diag/eval. End this mode can be disabled by setting variable to
false. Once disabled all bucket instances that need to be restarted
will restart.

Change-Id: I951eeb4b69971a606eaef06af7a7252d380f25ff
Reviewed-on: http://review.couchbase.org/42311
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Add zookeeper client.

Change-Id: I348153673d4b0328b97ad0db4940b2995bd0a78b
mark

Change-Id: I6d2dedff5c0e8db62a6a7ac9792e53de3b3a36f4
change handlers response format

Change-Id: I364de156e39d9c4a7c1df97618a0de83eed5adb1
Wrap connection into a state record.

Change-Id: Ie105df9000b9984ddc5fd9d863e84890381b8a09
watches

Change-Id: Iec183c0c5fe649a7444099dd59f9979861d3312e
Notify watcher only after new watch is set.

So if it needs to get the value, there's no race condition.

Change-Id: Ie3b6054e1e023dcce2f1cece86d3f59cf14a5242