]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-mon: dump monmap to debug logs
authorSage Weil <sage@redhat.com>
Wed, 9 Jan 2019 16:11:39 +0000 (10:11 -0600)
committerSage Weil <sage@redhat.com>
Fri, 11 Jan 2019 22:10:14 +0000 (16:10 -0600)
Verbosely during mkfs, at level 10 on normal startup.

Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph_mon.cc

index 9a9d33e61e4ef8b9513a1455c362b5e7088d1ac3..450544ae3daa3bc511191c820ed5d523de91ae84 100644 (file)
@@ -347,6 +347,9 @@ int main(int argc, const char **argv)
     // resolve public_network -> public_addr
     pick_addresses(g_ceph_context, CEPH_PICK_ADDRESS_PUBLIC);
 
+    dout(10) << "public_network " << g_conf()->public_network << dendl;
+    dout(10) << "public_addr " << g_conf()->public_network << dendl;
+
     common_init_finish(g_ceph_context);
 
     bufferlist monmapbl, osdmapbl;
@@ -369,7 +372,12 @@ int main(int argc, const char **argv)
       } catch (const buffer::error& e) {
        derr << argv[0] << ": error decoding monmap " << monmap_fn << ": " << e.what() << dendl;
        exit(1);
-      }      
+      }
+
+      dout(1) << "imported monmap:\n";
+      monmap.print(*_dout);
+      *_dout << dendl;
+      
     } else {
       ostringstream oss;
       int err = monmap.build_initial(g_ceph_context, true, oss);
@@ -379,6 +387,10 @@ int main(int argc, const char **argv)
        derr << argv[0] << ": warning: no initial monitors; must use admin socket to feed hints" << dendl;
       }
 
+      dout(1) << "initial generated monmap:\n";
+      monmap.print(*_dout);
+      *_dout << dendl;
+
       // am i part of the initial quorum?
       if (monmap.contains(g_conf()->name.get_id())) {
        // hmm, make sure the ip listed exists on the current host?
@@ -633,6 +645,13 @@ int main(int argc, const char **argv)
     } else {
       derr << "unable to obtain a monmap: " << cpp_strerror(err) << dendl;
     }
+
+    dout(10) << __func__ << " monmap:\n";
+    JSONFormatter jf(true);
+    jf.dump_object("monmap", monmap);
+    jf.flush(*_dout);
+    *_dout << dendl;
+
     if (!extract_monmap.empty()) {
       int r = mapbl.write_file(extract_monmap.c_str());
       if (r < 0) {