]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/HealthMonitor: raise MON_MSGR2_NOT_ENABLED if mons not bound to msgr2
authorSage Weil <sage@redhat.com>
Wed, 9 Jan 2019 03:53:45 +0000 (21:53 -0600)
committerSage Weil <sage@redhat.com>
Tue, 15 Jan 2019 16:42:29 +0000 (10:42 -0600)
If the ms_bind_msgr2 option is enabled, and all mons are nautilus,
raise a health alert if any mons aren't bound to msgr2 addresses.

Whitelist tests that mon_bind_addrvec=false or mon_bind_msgr2=false.

Signed-off-by: Sage Weil <sage@redhat.com>
doc/rados/operations/health-checks.rst
qa/suites/rados/thrash-old-clients/ceph.yaml
qa/suites/rados/upgrade/luminous-x-singleton/0-cluster/start.yaml
src/mon/HealthMonitor.cc
src/msg/msg_types.h

index d93fc6d296559f48c321a68de0e59484ade12367..06a52aedaacc2b41e45e68ea8e1ee9e478c6155e 100644 (file)
@@ -52,6 +52,26 @@ If it is impractical to keep the clocks closely synchronized, the
 value must stay significantly below the ``mon_lease`` interval in
 order for monitor cluster to function properly.
 
+MON_MSGR2_NOT_ENABLED
+_____________________
+
+The ``ms_bind_msgr2`` option is enabled but one or more monitors is
+not configured to bind to a v2 port in the cluster's monmap.  This
+means that features specific to the msgr2 protocol (e.g., encryption)
+are not available on some or all connections.
+
+In most cases this can be corrected by issuing the command::
+
+  ceph mon enable-msgr2
+
+That command will change any monitor configured for the old default
+port 6789 to continue to listen for v1 connections on 6789 and also
+listen for v2 connections on the new default 3300 port.
+
+If a monitor is configured to listen for v1 connections on a non-standard port (not 6789), then the monmap will need to be modified manually.
+
+
+
 Manager
 -------
 
index 1b9c85680055358d03c097a8e8e02a2fadb3b07e..b0c28783375bb50114590ddbfddb18d531da4e41 100644 (file)
@@ -1,3 +1,5 @@
 tasks:
 - ceph:
     mon_bind_addrvec: false
+    log-whitelist:
+      - \(MON_MSGR2_NOT_ENABLED\)
index c67ec972d91956210c8a983393a32def389a2502..308e1c60b23e9e2c7012c16e2dc74517c6ed66b5 100644 (file)
@@ -7,6 +7,8 @@ overrides:
   ceph:
     mon_bind_addrvec: false
     mon_bind_msgr2: false
+    log-whitelist:
+      - \(MON_MSGR2_NOT_ENABLED\)
     fs: xfs
     conf:
       global:
index e255b16e2f109f9779092e0f4d8b4a165fd091ff..845942514745a6c434ee8c0a3788938873eb39c8 100644 (file)
@@ -366,6 +366,27 @@ bool HealthMonitor::check_leader_health()
     }
   }
 
+  // MON_MSGR2_NOT_ENABLED
+  if (g_conf().get_val<bool>("ms_bind_msgr2") &&
+      mon->monmap->get_required_features().contains_all(
+       ceph::features::mon::FEATURE_NAUTILUS)) {
+    list<string> details;
+    for (auto& i : mon->monmap->mon_info) {
+      if (!i.second.public_addrs.has_msgr2()) {
+       ostringstream ds;
+       ds << "mon." << i.first << " is not bound to a msgr2 port, only "
+          << i.second.public_addrs;
+       details.push_back(ds.str());
+      }
+    }
+    if (!details.empty()) {
+      ostringstream ss;
+      ss << details.size() << " monitors have not enabled msgr2";
+      auto& d = next.add("MON_MSGR2_NOT_ENABLED", HEALTH_WARN, ss.str());
+      d.detail.swap(details);
+    }
+  }
+
   if (next != leader_checks) {
     changed = true;
     leader_checks = next;
index 1049ad540a0c1fe55bbcbd031217fbcd19b77606..8ae0bd52806b6446431d881a77b897a6d640bec4 100644 (file)
@@ -598,6 +598,14 @@ struct entity_addrvec_t {
     }
     return entity_addr_t();
   }
+  bool has_msgr2() const {
+    for (auto& a : v) {
+      if (a.is_msgr2()) {
+       return true;
+      }
+    }
+    return false;
+  }
 
   bool parse(const char *s, const char **end = 0);