prefork.exit(1);
}
if (ret > 0) {
- cout << "converting monitor store, please do not interrupt..." << std::endl;
+ dout(0) << "converting monitor store, please do not interrupt..." << dendl;
int r = converter.convert();
if (r) {
derr << "failed to convert monitor store: " << cpp_strerror(r) << dendl;
bufferlist magicbl;
err = store->get(Monitor::MONITOR_NAME, "magic", magicbl);
if (!magicbl.length()) {
- cerr << "unable to read magic from mon data.. did you run mkcephfs?" << std::endl;
+ derr << "unable to read magic from mon data.. did you run mkcephfs?" << dendl;
prefork.exit(1);
}
string magic(magicbl.c_str(), magicbl.length()-1); // ignore trailing \n
if (strcmp(magic.c_str(), CEPH_MON_ONDISK_MAGIC)) {
- cerr << "mon fs magic '" << magic << "' != current '" << CEPH_MON_ONDISK_MAGIC << "'" << std::endl;
+ derr << "mon fs magic '" << magic << "' != current '" << CEPH_MON_ONDISK_MAGIC << "'" << dendl;
prefork.exit(1);
}
err = Monitor::check_features(store);
if (err < 0) {
- cerr << "error checking features: " << cpp_strerror(err) << std::endl;
+ derr << "error checking features: " << cpp_strerror(err) << dendl;
prefork.exit(1);
}
std::string error;
int r = bl.read_file(inject_monmap.c_str(), &error);
if (r) {
- cerr << "unable to read monmap from " << inject_monmap << ": "
- << error << std::endl;
+ derr << "unable to read monmap from " << inject_monmap << ": "
+ << error << dendl;
prefork.exit(1);
}
// get next version
version_t v = store->get("monmap", "last_committed");
- cout << "last committed monmap epoch is " << v << ", injected map will be " << (v+1) << std::endl;
+ dout(0) << "last committed monmap epoch is " << v << ", injected map will be " << (v+1)
+ << dendl;
v++;
// set the version
MonMap tmp;
tmp.decode(bl);
if (tmp.get_epoch() != v) {
- cout << "changing monmap epoch from " << tmp.get_epoch() << " to " << v << std::endl;
+ dout(0) << "changing monmap epoch from " << tmp.get_epoch()
+ << " to " << v << dendl;
tmp.set_epoch(v);
}
bufferlist mapbl;
t.put("monmap", "last_committed", v);
store->apply_transaction(t);
- cout << "done." << std::endl;
+ dout(0) << "done." << dendl;
prefork.exit(0);
}
if (g_conf->get_val_from_conf_file(my_sections, "mon addr",
mon_addr_str, true) == 0) {
if (conf_addr.parse(mon_addr_str.c_str()) && (ipaddr != conf_addr)) {
- cerr << "WARNING: 'mon addr' config option " << conf_addr
+ derr << "WARNING: 'mon addr' config option " << conf_addr
<< " does not match monmap file" << std::endl
- << " continuing with monmap configuration" << std::endl;
+ << " continuing with monmap configuration" << dendl;
}
}
} else {
MonMap tmpmap;
int err = tmpmap.build_initial(g_ceph_context, cerr);
if (err < 0) {
- cerr << argv[0] << ": error generating initial monmap: " << cpp_strerror(err) << std::endl;
+ derr << argv[0] << ": error generating initial monmap: "
+ << cpp_strerror(err) << dendl;
usage();
prefork.exit(1);
}
messenger->set_policy_throttlers(entity_name_t::TYPE_OSD, daemon_throttler, NULL);
messenger->set_policy_throttlers(entity_name_t::TYPE_MDS, daemon_throttler, NULL);
- cout << "starting " << g_conf->name << " rank " << rank
+ dout(0) << "starting " << g_conf->name << " rank " << rank
<< " at " << ipaddr
<< " mon_data " << g_conf->mon_data
<< " fsid " << monmap.get_fsid()
- << std::endl;
+ << dendl;
err = messenger->bind(ipaddr);
if (err < 0)