int err;
bool mkfs = false;
+ bool compact = false;
std::string osdmapfn, inject_monmap;
vector<const char*> args;
exit(0);
} else if (ceph_argparse_flag(args, i, "--mkfs", (char*)NULL)) {
mkfs = true;
+ } else if (ceph_argparse_flag(args, i, "--compact", (char*)NULL)) {
+ compact = true;
} else if (ceph_argparse_witharg(args, i, &val, "--osdmap", (char*)NULL)) {
osdmapfn = val;
} else if (ceph_argparse_witharg(args, i, &val, "--inject_monmap", (char*)NULL)) {
if (err < 0)
return 1;
+ if (compact || g_conf->mon_compact_on_start) {
+ derr << "compacting monitor store ..." << dendl;
+ mon->store->compact();
+ derr << "done compacting" << dendl;
+ }
+
global_init_daemonize(g_ceph_context, 0);
common_init_finish(g_ceph_context);
global_init_chdir(g_ceph_context);
OPTION(mon_data, OPT_STR, "/var/lib/ceph/mon/$cluster-$id")
OPTION(mon_initial_members, OPT_STR, "") // list of initial cluster mon ids; if specified, need majority to form initial quorum and create new cluster
OPTION(mon_sync_fs_threshold, OPT_INT, 5) // sync() when writing this many objects; 0 to disable.
+OPTION(mon_compact_on_start, OPT_BOOL, false) // compact leveldb on ceph-mon start
OPTION(mon_tick_interval, OPT_INT, 5)
OPTION(mon_subscribe_interval, OPT_DOUBLE, 300)
OPTION(mon_osd_laggy_halflife, OPT_INT, 60*60) // (seconds) how quickly our laggy estimations decay