From: Sage Weil Date: Wed, 9 Jan 2019 16:11:39 +0000 (-0600) Subject: ceph-mon: dump monmap to debug logs X-Git-Tag: v14.1.0~420^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=65fb65c1ce12192014ebff5096e30ab8ed9a1a86;p=ceph.git ceph-mon: dump monmap to debug logs Verbosely during mkfs, at level 10 on normal startup. Signed-off-by: Sage Weil --- diff --git a/src/ceph_mon.cc b/src/ceph_mon.cc index 9a9d33e61e4e..450544ae3daa 100644 --- a/src/ceph_mon.cc +++ b/src/ceph_mon.cc @@ -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) {