summaryrefslogtreecommitdiff
path: root/provider_base/services/_couchdb_mirror.json
blob: 67004c704ae9cd082900e38611bfcbda4d6acfec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//
// Applied to all non-master couchdb nodes
//
{
  "stunnel": {
    "couch_client": "= stunnel_client(nodes[couch.replication.masters.keys], couch.port)"
  },
  "couch": {
    "mode": "mirror",
    "replication": {
      // for now, pick the first close one, or the first one.
      // in the future, maybe use haproxy to balance among all the masters
      "masters": "= try{pick_node(:couch_master,nodes_near_me['services' => 'couchdb']['couch.master' => true]).pick_fields('domain.internal')} || try{pick_node(:couch_master,nodes_like_me['services' => 'couchdb']['couch.master' => true]).pick_fields('domain.internal')}"
    }
  }
}