From db669a6911c55d9a5675fb4b42f4de5728f34c76 Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 19 Jun 2014 00:02:54 -0700 Subject: couchdb: generate hiera files suitable for plain couchdb + read-only mirrors --- provider_base/services/_couchdb_mirror.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 provider_base/services/_couchdb_mirror.json (limited to 'provider_base/services/_couchdb_mirror.json') diff --git a/provider_base/services/_couchdb_mirror.json b/provider_base/services/_couchdb_mirror.json new file mode 100644 index 00000000..67004c70 --- /dev/null +++ b/provider_base/services/_couchdb_mirror.json @@ -0,0 +1,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')}" + } + } +} \ No newline at end of file -- cgit v1.2.3