How to connect Couchbase Sync gateway with multiple couchbase server nodes

Hi
I have three nodes. node 1 and node 2. node 2 join to node 1.
node 3 running with couchbase sync gateway. Here i have a question. How to connect node 3 to node 1 and node 2. i mean couchbase sync gateway to couchbase server.

Please provide any documentation link.

@itssrinadh, yes you can have 3 server nodes communicate to sync-gateway. In sync gateway config file, you can add ip address of each server node separate by comma to the ‘server’ key. You can have config like something like below, I have highlighted in bold and italicized.
{
“interface”:":4984",
“adminInterface”: “0.0.0.0:4985”,
“maxIncomingConnections”: 0,
“maxCouchbaseConnections”: 16,
“maxFileDescriptors”: 90000,
“slowServerCallWarningThreshold”: 500,
“compressResponses”: false,
“logging”: {“debug”: {“enabled”: true} },
“databases”:{
“db”:{
“num_index_replicas”: 0,
“username”: “travel-sample”,
“password”: “password”,
"server":“http://11.111.11.111,22.222.22.222,33.333.33.333:8091”,
“bucket”:“sample”
}
}
}

1 Like

Thank you @sridevi.saragadam But why we need to use num_index_replicas if we have more than one node? what should i keep num_index_replicas if i use more than one node for server

@itssrinadh, you do not need to use num_index_replicas. It was just my sample config. Just consider only ‘server’ key in sample config to meet your requirement.

1 Like

sure, Thank you. i am doing like that and i am just setting my server ip address.

Perfect solutions and working awesome.