]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cookbooks.git/commitdiff
osd: be more generous about accepting monitors.
authorGreg Farnum <greg@inktank.com>
Tue, 28 Aug 2012 22:41:54 +0000 (15:41 -0700)
committerGreg Farnum <greg@inktank.com>
Thu, 6 Sep 2012 20:18:00 +0000 (13:18 -0700)
The solr database doesn't update quickly enough for our search to
work well on initial bringup.
Instead, fail if we actually have no monitors, but otherwise loop
until our search for a mon with the osd bootstrap key succeeds.

recipes/bootstrap_osd.rb

index ec1e3e34be29e8e41c60d73bee0a25d8c4db249b..27e74d96a631de658a46b16c7c6f51989f2d4691 100644 (file)
@@ -7,12 +7,19 @@ package 'gdisk' do
   action :upgrade
 end
 
-mons = get_mon_nodes("ceph_bootstrap_osd_key:*")
+mons = get_mon_nodes()
+have_mons = !mons.empty?
+mons = get_mon_nodes("ceph_bootstrap_osd_key")
 
-if mons.empty? then
+if not have_mons then
   puts "No ceph-mon found."
 else
 
+  while mons.empty?
+    sleep(1)
+    mons = get_mon_nodes("ceph_bootstrap_osd_key")
+  end # while mons.empty?
+
   directory "/var/lib/ceph/bootstrap-osd" do
     owner "root"
     group "root"