From eeb4d5f3b1c192e69e92c312652217e606ca8ecb Mon Sep 17 00:00:00 2001 From: Jiri Stransky Date: Fri, 16 Sep 2016 16:41:58 +0200 Subject: Wait for MongoDB connections before creating replset Sometimes the mongodb_replset resource fails with: Could not evaluate: Can't find master host for replicaset tripleo. This issue is intermittent so the fix cannot be perfectly verified, but the assumption is that if we wait for MongoDB to be reachable on all nodes, it will assure that the members will appear to the puppet module as alive when creating or verifying the replset. If the validation fails, it should help us uncover which of the members was causing trouble. Change-Id: I0bcd0d063a7a766483426fdd5ea81cbe1dfaa348 Closes-Bug: #1624420 --- manifests/profile/base/database/mongodb.pp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'manifests/profile/base/database/mongodb.pp') diff --git a/manifests/profile/base/database/mongodb.pp b/manifests/profile/base/database/mongodb.pp index 1a19bb6..8967f5b 100644 --- a/manifests/profile/base/database/mongodb.pp +++ b/manifests/profile/base/database/mongodb.pp @@ -44,6 +44,13 @@ class tripleo::profile::base::database::mongodb ( include ::tripleo::profile::base::database::mongodbcommon if $bootstrap_node == $::hostname { + # make sure we can connect to all servers before forming the replset + tripleo::profile::pacemaker::database::mongodbvalidator { + $tripleo::profile::base::database::mongodbcommon::mongodb_node_ips : + port => $tripleo::profile::base::database::mongodbcommon::port, + require => Service['mongodb'], + before => Mongodb_replset[$mongodb_replset], + } mongodb_replset { $mongodb_replset : members => $tripleo::profile::base::database::mongodbcommon::mongo_node_ips_with_port_nobr, } -- cgit 1.2.3-korg