aboutsummaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorcarey.xu <carey.xuhan@huawei.com>2016-01-11 15:47:14 +0800
committercarey.xu <carey.xuhan@huawei.com>2016-01-11 15:47:14 +0800
commitda39c5ca863f133f6bbf978dce10b9d21b6b5399 (patch)
tree0c0678b2e6d91bfab3c6b93703d328a446eb1d5b /deploy
parentc2dd674b7c65256dfa88d97a5604a592e9a024fd (diff)
bugfix: mongodb's priority should consistent with keepalived for failover
JIRA: COMPASS-260 Change-Id: I29e6e21e514e6dab5643e5558c81b851a4442e54 Signed-off-by: carey.xu <carey.xuhan@huawei.com>
Diffstat (limited to 'deploy')
-rw-r--r--deploy/adapters/ansible/roles/database/templates/replica.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/deploy/adapters/ansible/roles/database/templates/replica.js b/deploy/adapters/ansible/roles/database/templates/replica.js
index d19db50d..dd5fc575 100644
--- a/deploy/adapters/ansible/roles/database/templates/replica.js
+++ b/deploy/adapters/ansible/roles/database/templates/replica.js
@@ -1,7 +1,7 @@
config = { _id:"compass", members:[
{% for host in haproxy_hosts.values() %}
{% set pair = '%s:27017' % host %}
- {_id:{{ loop.index0 }},host:"{{ pair }}",priority:{{ haproxy_hosts|length - loop.index0 }}},
+ {_id:{{ loop.index0 }},host:"{{ pair }}",priority:{{ host_index[inventory_hostname] + 1 }}},
{% endfor %}
]
};