I have a Couchbase 5.0 cluster that includes 3 nodes with 2 replicas.
I want to configure the Sync Gateway machine to have access for all the Couchbase server cluster, since I don't want it to be a single point of failure, but I only have the server in the configuration file and it seems that it gets only one URL.
{
"log": ["*"],
"databases": {
"facts": {
"server": "http://192.168.1.1:8091",
"bucket": "bucketName",
"username":"userName",
"password":"password",
"roles":{
"firstRole": {"admin_channels":[]}
},
"users": { "GUEST": { "disabled": true, "admin_channels": ["*"] } },
"sync":`
function(doc,oldDoc)
{
...
}
}
How Can I configure the Sync Gateway to know all the cluster URLs?
There is a simple way to configure the URL to support all the URLs in the cluster.
But first, it is important to understand that even if you have one URL that points for one of the Couchbase cluster nodes, Sync-Gateway gets the topology cluster from this URL and knows about all the cluster nodes.
Nevertheless, you can configure the Sync-Gateway server like that:
If you have 3 Couchbase nodes with the following URLs:
192.168.1.1
192.168.1.2
192.168.1.3
and you want that Sync-Gateway will know all of them you need configure the following in the server value:
"server": "http://192.168.1.1,192.168.1.2,192.168.1.3:8091"
It looks in the configuration file like the following:
{
"log": ["*"],
"databases": {
"facts": {
"server": "http://192.168.1.1,192.168.1.2,192.168.1.3:8091",
"bucket": "bucketName",
"username":"userName",
"password":"password",
"roles":{
"firstRole": {"admin_channels":[]}
},
"users": { "GUEST": { "disabled": true, "admin_channels": ["*"] } },
"sync":`
function(doc,oldDoc)
{
...
}
}
I know it looks weird, but this is how you configure Sync-Gateway.
I hope it helps.