} else if (!g_conf->public_addr.is_blank_ip()) {
entity_addr_t a = g_conf->public_addr;
if (a.get_port() == 0)
- a.set_port(CEPH_MON_PORT);
+ a.set_port(CEPH_MON_PORT_LEGACY);
if (monmap.contains(a)) {
string name;
monmap.get_addr_name(a, name);
mon_addr_str, true) == 0) {
if (conf_addr.parse(mon_addr_str.c_str())) {
if (conf_addr.get_port() == 0)
- conf_addr.set_port(CEPH_MON_PORT);
+ conf_addr.set_port(CEPH_MON_PORT_LEGACY);
if (ipaddr != conf_addr) {
derr << "WARNING: 'mon addr' config option " << conf_addr
<< " does not match monmap file" << std::endl
if (!g_conf->public_addr.is_blank_ip()) {
ipaddr = g_conf->public_addr;
if (ipaddr.get_port() == 0)
- ipaddr.set_port(CEPH_MON_PORT);
+ ipaddr.set_port(CEPH_MON_PORT_LEGACY);
dout(0) << "using public_addr " << g_conf->public_addr << " -> "
<< ipaddr << dendl;
} else {
// set the default port if not already set
if (bind_addr.get_port() == 0) {
- bind_addr.set_port(CEPH_MON_PORT);
+ bind_addr.set_port(CEPH_MON_PORT_LEGACY);
}
}
* Data types for message passing layer used by Ceph.
*/
-#define CEPH_MON_PORT 6789 /* default monitor port */
+#define CEPH_MON_PORT_LEGACY 6789 /* legacy default monitor port */
+#define CEPH_MON_PORT_IANA 3300 /* IANA monitor port */
/*
* client-side processes will try to bind to ports in this
n[0] = 'a' + i;
n[1] = 0;
if (addrs[i].get_port() == 0)
- addrs[i].set_port(CEPH_MON_PORT);
+ addrs[i].set_port(CEPH_MON_PORT_LEGACY);
string name = prefix;
name += n;
if (!contains(addrs[i]))
n[0] = 'a' + i;
n[1] = 0;
if (addrs[i].get_port() == 0)
- addrs[i].set_port(CEPH_MON_PORT);
+ addrs[i].set_port(CEPH_MON_PORT_LEGACY);
string name = prefix;
name += n;
if (!contains(addrs[i]) &&
continue;
}
if (addr.get_port() == 0)
- addr.set_port(CEPH_MON_PORT);
+ addr.set_port(CEPH_MON_PORT_LEGACY);
uint16_t priority = 0;
if (!conf->get_val_from_conf_file(sections, "mon priority", val, false)) {
}
if (addr.get_port() == 0)
- addr.set_port(CEPH_MON_PORT);
+ addr.set_port(CEPH_MON_PORT_LEGACY);
extra_probe_peers.insert(addr);
ss << "adding peer " << addr << " to list: " << extra_probe_peers;
f->flush(rdata);
ostringstream ss2;
- ss2 << "report " << rdata.crc32c(CEPH_MON_PORT);
+ ss2 << "report " << rdata.crc32c(CEPH_MON_PORT_LEGACY);
rs = ss2.str();
r = 0;
} else if (prefix == "osd last-stat-seq") {
}
if (addr.get_port() == 0) {
- ss << "port defaulted to " << CEPH_MON_PORT;
- addr.set_port(CEPH_MON_PORT);
+ ss << "port defaulted to " << CEPH_MON_PORT_LEGACY;
+ addr.set_port(CEPH_MON_PORT_LEGACY);
}
/**
return -1;
}
if (addr.get_port() == 0)
- addr.set_port(CEPH_MON_PORT);
+ addr.set_port(CEPH_MON_PORT_LEGACY);
add[name] = addr;
modified = true;
i = args.erase(i);