]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cookbooks.git/commitdiff
Give ceph-mon hints about its peers.
authorTommi Virtanen <tv@inktank.com>
Fri, 8 Jun 2012 21:55:07 +0000 (14:55 -0700)
committerTommi Virtanen <tv@inktank.com>
Fri, 8 Jun 2012 21:55:07 +0000 (14:55 -0700)
This handles the case where ceph-mon already started, already read a
mon_host from ceph.conf, but more nodes (needed for initial quorum)
had the ceph-mon role added to them after the fact, and thus weren't
in mon_host at startup time.

ceph/recipes/mon.rb

index 4347e9ef0cdb4236cc5caf3f0c66e81c126940ba..13d067b33470823cd6e24fdfa9596183511a1405 100644 (file)
@@ -40,6 +40,18 @@ EOH
   notifies :start, "service[ceph-mon-all-starter]", :immediately
 end
 
+ruby_block "tell ceph-mon about its peers" do
+  block do
+    mon_addresses = get_mon_addresses()
+    mon_addresses.each do |addr|
+      system 'ceph', \
+        '--admin-daemon', "/var/run/ceph/ceph-mon.#{node['hostname']}.asok", \
+        'add_bootstrap_peer_hint', "#{addr}"
+      # ignore errors
+    end
+  end
+end
+
 ruby_block "create client.admin keyring" do
   block do
     if not ::File.exists?('/etc/ceph/ceph.client.admin.keyring') then