]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/MgrStandby: add mgr_standby_modules option
authorSage Weil <sage@newdream.net>
Tue, 4 May 2021 14:57:16 +0000 (09:57 -0500)
committerSage Weil <sage@newdream.net>
Tue, 4 May 2021 14:57:16 +0000 (09:57 -0500)
Add config option to control whether the standby modules are started.
Default to true (no change in behavior), but if set to false the standby
mgr modules don't do the redirect business.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 35d2146c1a801a2b478a19b9d62af0f10279fd34)

# Conflicts:
# src/common/options/global.yaml.in
 - added to options.cc instead

src/common/options.cc
src/mgr/MgrStandby.cc

index 5e640acd67bf631ca49489f9e455d8f46af9ccd1..434f5cc044528740c4f627bf79f78d98193246f4 100644 (file)
@@ -5445,6 +5445,17 @@ std::vector<Option> get_global_options() {
     .add_service("mgr")
     .set_description("Filesystem path to manager modules."),
 
+    Option("mgr_standby_modules", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(true)
+    .set_description("Start modules in standby (redirect) mode when mgr is standby")
+    .set_long_description(
+      "By default, the standby modules will answer incoming requests with a "
+      "HTTP redirect to the active manager, allowing users to point their browser at any "
+      "mgr node and find their way to an active mgr.  However, this mode is problematic "
+      "when using a load balancer because (1) the redirect locations are usually private "
+      "IPs and (2) the load balancer can't identify which mgr is the right one to send "
+      "traffic to. If a load balancer is being used, set this to false."),
+
     Option("mgr_disabled_modules", Option::TYPE_STR, Option::LEVEL_ADVANCED)
 #ifdef MGR_DISABLED_MODULES
     .set_default(MGR_DISABLED_MODULES)
index 585837802f501f6dbe7e97831c0a5d38b7983e88..fdb55c52027c8b624a279229cfea9f97cbb87f80 100644 (file)
@@ -424,7 +424,8 @@ void MgrStandby::handle_mgr_map(ref_t<MMgrMap> mmap)
     if (map.active_gid != 0 && map.active_name != g_conf()->name.get_id()) {
       // I am the standby and someone else is active, start modules
       // in standby mode to do redirects if needed
-      if (!py_module_registry.is_standby_running()) {
+      if (!py_module_registry.is_standby_running() &&
+         g_conf().get_val<bool>("mgr_standby_modules")) {
         py_module_registry.standby_start(monc, finisher);
       }
     }