]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/MgrStandby: add mgr_standby_modules option
authorSage Weil <sage@newdream.net>
Tue, 13 Apr 2021 14:11:31 +0000 (10:11 -0400)
committerSage Weil <sage@newdream.net>
Fri, 16 Apr 2021 20:00:31 +0000 (16:00 -0400)
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>
src/common/options/global.yaml.in
src/mgr/MgrStandby.cc

index 5c7f4a4317fd7763c12c3e9534a184d8054bc9b7..c27feef5e7778b051db2c461bdace3f839270e4a 100644 (file)
@@ -7814,6 +7814,17 @@ options:
   default: @CEPH_INSTALL_DATADIR@/mgr
   services:
   - mgr
+- name: mgr_standby_modules
+  type: bool
+  default: true
+  level: advanced
+  desc: Start modules in standby (redirect) mode when mgr is standby
+  long_desc: 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.
 - name: mgr_disabled_modules
   type: str
   level: advanced
index 37a2219bccbde21e8a20b747d031fbced409f9ed..ea15a1456eb5d95d28dfad0916f3156f84ce2315 100644 (file)
@@ -425,7 +425,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);
       }
     }