]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
CEPH_MON_PORT -> CEPH_MON_PORT_LEGACY; define CEPH_MON_PORT_IANA
authorSage Weil <sage@redhat.com>
Wed, 23 May 2018 22:17:09 +0000 (17:17 -0500)
committerSage Weil <sage@redhat.com>
Tue, 3 Jul 2018 18:01:23 +0000 (13:01 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph_mon.cc
src/include/msgr.h
src/mon/MonMap.cc
src/mon/Monitor.cc
src/mon/MonmapMonitor.cc
src/tools/monmaptool.cc

index 025d01858249ed69464d0c902dfffd05676e8f15..bc3744c55b22850a00b1043510b23a3e9f3e0ab0 100644 (file)
@@ -366,7 +366,7 @@ int main(int argc, const char **argv)
       } 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);
@@ -633,7 +633,7 @@ int main(int argc, const char **argv)
                                       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
@@ -650,7 +650,7 @@ int main(int argc, const char **argv)
     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 {
@@ -722,7 +722,7 @@ int main(int argc, const char **argv)
 
     // 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);
     }
   }
 
index 1953eb28b40b44d2515259049c86f36c632ec08b..2b8e6be46ff548756d1719465ad8fe222f43a030 100644 (file)
@@ -11,7 +11,8 @@
  * 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
index 56d8926e28b441597f049142158a2b67db5fa4c3..24b0db5cd03696d16940f72f53b9a22926868f9b 100644 (file)
@@ -329,7 +329,7 @@ int MonMap::build_from_host_list(std::string hostlist, const std::string &prefix
       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]))
@@ -355,7 +355,7 @@ int MonMap::build_from_host_list(std::string hostlist, const std::string &prefix
     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]) &&
@@ -495,7 +495,7 @@ int MonMap::build_initial(CephContext *cct, ostream& errout)
       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)) {
index a942b4cd5974061575f6abd079f5f477e4958753..45a8ea4a9a1254ec46fce12238b1ab2703dc4fe2 100644 (file)
@@ -1090,7 +1090,7 @@ bool Monitor::_add_bootstrap_peer_hint(std::string_view cmd,
   }
 
   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;
@@ -3344,7 +3344,7 @@ void Monitor::handle_command(MonOpRequestRef op)
     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") {
index d9158485df98493cdf6e9077ce890bd27e64c329..aec6ec28de4dfcd77c01deb674e38ffcac32b0a0 100644 (file)
@@ -504,8 +504,8 @@ bool MonmapMonitor::prepare_command(MonOpRequestRef op)
     }
 
     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);
     }
 
     /**
index 19030eba021f2d13996810c2fa009b6a8cb49130..2a2163bc390394c73f17eb05ad6fbc393e7a6e0e 100644 (file)
@@ -219,7 +219,7 @@ int main(int argc, const char **argv)
        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);