From: Sage Weil Date: Wed, 30 Nov 2011 05:06:29 +0000 (-0800) Subject: osd: --get-osd-fsid and --get-cluster-fsid X-Git-Tag: v0.40~137^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c59eb8ca33a415d5afdd4585b69c979766cc0942;p=ceph.git osd: --get-osd-fsid and --get-cluster-fsid Signed-off-by: Sage Weil --- diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc index c51b68244441..a12a73367e49 100644 --- a/src/ceph_osd.cc +++ b/src/ceph_osd.cc @@ -65,6 +65,8 @@ int main(int argc, const char **argv) bool mkkey = false; bool flushjournal = false; bool convertfilestore = false; + bool get_osd_fsid = false; + bool get_cluster_fsid = false; std::string dump_pg_log; std::string val; @@ -86,6 +88,10 @@ int main(int argc, const char **argv) convertfilestore = true; } else if (ceph_argparse_witharg(args, i, &val, "--dump-pg-log", (char*)NULL)) { dump_pg_log = val; + } else if (ceph_argparse_flag(args, i, "--get-cluster-fsid", (char*)NULL)) { + get_cluster_fsid = true; + } else if (ceph_argparse_flag(args, i, "--get-osd-fsid", (char*)NULL)) { + get_osd_fsid = true; } else { ++i; } @@ -213,9 +219,9 @@ int main(int argc, const char **argv) } string magic; - uuid_d fsid; + uuid_d cluster_fsid, osd_fsid; int w; - int r = OSD::peek_meta(g_conf->osd_data, magic, fsid, w); + int r = OSD::peek_meta(g_conf->osd_data, magic, cluster_fsid, osd_fsid, w); if (r < 0) { derr << TEXT_RED << " ** ERROR: unable to open OSD superblock on " << g_conf->osd_data << ": " << cpp_strerror(-r) @@ -236,6 +242,15 @@ int main(int argc, const char **argv) exit(1); } + if (get_cluster_fsid) { + cout << cluster_fsid << std::endl; + exit(0); + } + if (get_osd_fsid) { + cout << osd_fsid << std::endl; + exit(0); + } + pick_addresses(g_ceph_context); if (g_conf->public_addr.is_blank_ip() && !g_conf->cluster_addr.is_blank_ip()) { @@ -262,7 +277,7 @@ int main(int argc, const char **argv) global_print_banner(); cout << "starting osd." << whoami - << " at " << client_messenger->get_ms_addr() + << " at " << client_messenger->get_ms_addr() << " osd_data " << g_conf->osd_data << " " << ((g_conf->osd_journal.empty()) ? "(no journal)" : g_conf->osd_journal)