• Home
  • History
  • Annotate
  • only in this directory
Name Date Size

..19-Aug-20204 KiB

.gitignoreH A D19-Aug-2020309

adminport/H19-Aug-20204 KiB

base/H19-Aug-20204 KiB

build.shH A D19-Aug-20201.1 KiB

capi_utils/H19-Aug-20204 KiB

CMakeLists.txtH A D19-Aug-20202.3 KiB

common/H19-Aug-20204 KiB

component/H19-Aug-20204 KiB

connector/H19-Aug-20204 KiB

docs/H19-Aug-20204 KiB

etc/H19-Aug-20204 KiB

factory/H19-Aug-20204 KiB

gen_server/H19-Aug-20204 KiB

interface_test/H19-Aug-20204 KiB

log/H19-Aug-20204 KiB

main/H19-Aug-20204 KiB

metadata/H19-Aug-20204 KiB

metadata_svc/H19-Aug-20204 KiB

parts/H19-Aug-20204 KiB

pipeline/H19-Aug-20204 KiB

pipeline_ctx/H19-Aug-20204 KiB

pipeline_manager/H19-Aug-20204 KiB

pipeline_svc/H19-Aug-20204 KiB

pipeline_utils/H19-Aug-20204 KiB

README.mdH A D19-Aug-20206 KiB

replication_manager/H19-Aug-20204 KiB

resource_manager/H19-Aug-20204 KiB

run_unit_tests.shH A D19-Aug-2020630

service_def/H19-Aug-20204 KiB

service_impl/H19-Aug-20204 KiB

supervisor/H19-Aug-20204 KiB

tests/H19-Aug-20204 KiB

tools/H19-Aug-20204 KiB

utils/H19-Aug-20204 KiB


3To build couchbase:
41. go to couchbase root dir
52. make
7After starting couchbase server, goxdcr will be started automatically, typically at localhost:13000 
10To build and test locally:
111. go to project root dir
122. sh ./build.sh
14This will build the entire goxdcr project, including the test dirs, and put an executable for xdcr rest service named "xdcr" under root/bin
16To start xdcr rest service:
171. go to root/bin
182. ./xdcr 
20This will start xdcr rest service on the local machine at address localhost:13000
22Optional input arguments to xdcr:
231. sourceKVAdminPort - adminport for source KV where xdcr is running on. Defaulted to 9000. 
24If the xdcr instance is running on AWS instances, the source KV adminport may be different and need to be explicitly specified: 
25./xdcr -sourceKVAdminPort=8091	
262. xdcrRestPort - port number for xdcr rest server. Defaulted to 13000. Generally there is no need to change it.
273. gometaRequestPort - request port number for gometa service. Defaulted to 11000. Generally there is no need to change it.
284. isEnterprise - whether couchbase is of enterprise edition. Defaulted to true.
295. isConvert - whether xdcr is running in convert/upgrade mode. Defaulted to false.
32To send requests to xdcr rest service:
331. To create remote cluster reference: "curl -X POST http://localhost:13000/pools/default/remoteClusters -d ..."
34	(1) required parameters: 
35		(a) name, string, e.g., "remote"
36		(b) hostname, string, e.g., ""
37		(c) username, string, e.g., "Administrator"
38		(d) password, string, e.g., "welcome"
39	(2) optional parameters: 
40		(a) demandEncryption, bool; when demandEncryption is set to true, a certificate must be provided as follows:
41		    -d demandEncryption=1 --data-urlencode "certificate=$(cat remoteCert.pem)"
422. To look up existsing remote cluster references:  "curl -X GET http://localhost:13000/pools/default/remoteClusters"
433. To delete remote cluster reference: "curl -X Delete  http://localhost:13000/pools/default/remoteClusters/<remote cluster name>"
454. To create replication: "curl -X POST http://localhost:13000/controller/createReplication -d ..."
46If the replication is created successfully, a replication id will be returned, which can be used to access the same replication in replication specific rest apis.
47	(1) required parameters: 
48		(a) toCluster, string, name of the remote cluster reference, e.g., "remote"
49		(b) fromBucket, string, e.g., "default"
50		(c) toBucket, string, e.g., "target"
51	(2) optional parameters. Optionally, the following replication settings can be passed in to fine tune replication behavior
52		(a) type, string, type of replication protocol, i.e., "xmem"/"capi"
53		(b) filterExpression, string, e.g., "default-1.*"
54		(c) pausedRequested, bool, whether the replications needs to be paused
55		(d) checkpointInterval, int, the interval for checkpointing in seconds, range: 60-14400
56		(e) workerBatchSize, int, the number of mutations in a batch, range: 500-10000
57		(f) docBatchSizeKb, int, the size of a batch in KB, range: 10-10000
58		(g) failureRestartInterval, int, the number of seconds to wait after failure before restarting replication, range: 1-300
59		(h) optimisticReplicationThreshold, int, documents with size less than this threshold (in bytes) will be replicated optimistically, range: 0-20*1024*1024
60 		(j) sourceNozzlePerNode, int, the number of source nozzles per source node, range: 1-10
61 		(k) targetNozzlePerNode, int, the number of outgoing nozzles per target node, range: 1-10
62 		(l) maxExpectedReplicationLag, int, the maximum replication lag (in millisecond) that can be tolerated before it is considered timeout
63 		(m) timeoutPercentageCap, int, the maximum allowed timeout percentage. If this limit is exceeded, replication is considered as not healthy and may be restarted.
64 		(n) logLevel, string, the level of logging, i.e., "Error"/"Info"/"Debug"/"Trace"
65 		(o) statsInterval, int, the interval (in milliseconds) for statistics updates
675. To view replication settings for a replication: "curl -X GET http://localhost:13000/settings/replications/<replication id>"
686. To change replication settings for a replication: "curl -X POST http://localhost:13000/settings/replications/<replication id> -d ..."
69Any of the replication settings in 4.(2) can be specified.
707. To pause a replication: "curl -X POST http://localhost:13000/settings/replications/<replication id> -d pauseRequested=true"
718. To resume a replication: "curl -X POST http://localhost:13000/settings/replications/<replication id> -d pauseRequested=false"
729. To delete a replication: "curl -X Delete http://localhost:13000/settings/replications/<replication id>"
7510. To view default settings for all replications: "curl -X GET http://localhost:13000/settings/replications"
7611. To change default settings for all replications: "curl -X POST http://localhost:13000/settings/replications -d ..."
77Any of the replication settings in 4.(2) can be specified.
8012. To view internal settings for all replications: "curl -X GET http://localhost:13000/internalSettings"
8113. To change internal settings for all replications: "curl -X POST http://localhost:13000/internalSettings -d ..."
82Any of the replication settings in 4.(2) can be specified. 
83Note that the name of each replication setting in 4.(2) will have to take a new form here, i.e., by changing the first letter to capital letter and then prefixing with "xdcr". 
84For example, for checkpointInterval, use xdcrCheckpointInterval instead. => "curl -X POST http://localhost:13000/internalSettings -d xdcrCheckpointInterval=1000"
85The reason for this is that internalSettings/ is a generic purpose API which is supposed to return both xdcr and non-xdcr settings. The "xdcr" prefix for 
86xdcr settings are useful in separating them from non-xdcr settings. /settings/replications, on the other hand, is a xdcr specific API. The "xdcr" prefix
87would have been redundant there.
8914. To get statistics: "curl -X GET http://localhost:13000/stats/buckets/<bucket name>"
9015. To get detail stats and additional debugging information "curl -X GET http://localhost:13000/debug/vars"