From a5a8d224786bd47dbca07f7fc485a0b1be833466 Mon Sep 17 00:00:00 2001 From: wangxiao86 Date: Fri, 26 Apr 2019 11:49:22 +0800 Subject: [PATCH] Set the module's server_addr path with the mgr's name. To enable multiple mgrs to run properly, we need to set the respective server_addr path with the mgr's name for the modules of each mgr. When multiple mgrs are running, the modules( e.g. dashboard and Prometheus ) of each mgr need to bind its own server_addr when it is started. The way to get server_addr when ceph mgr starts the module is as follows: first, get the server_addr value by "mgr///server_addr" path; and if this path does not exist, then get the server_addr value by" mgr//server_addr" path. According to the original rook setting for server_addr, the modules of all mgrs take the same server_addr on ceph luminous and mimic, this produces a wrong result that only one mgr's modules can run properly ( the modules of other mgrs failed to start with the wrong server_addr). This change is made to be compatible with ceph luminous, mimic, and nautilus. and Modify according to: the "HOST NAME AND PORT" description of http://docs.ceph.com/docs/master/mgr/dashboard/ . Signed-off-by: wangxiao86 --- pkg/operator/ceph/cluster/mgr/spec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/operator/ceph/cluster/mgr/spec.go b/pkg/operator/ceph/cluster/mgr/spec.go index 3e7d5cb4e..eacc52aeb 100644 --- a/pkg/operator/ceph/cluster/mgr/spec.go +++ b/pkg/operator/ceph/cluster/mgr/spec.go @@ -135,7 +135,7 @@ func (c *Cluster) makeSetServerAddrInitContainer(mgrConfig *mgrConfig, mgrModule } else { cfgSetArgs = append(cfgSetArgs, fmt.Sprintf("mgr.%s", mgrConfig.DaemonID)) } - cfgPath := fmt.Sprintf("mgr/%s/server_addr", mgrModule) + cfgPath := fmt.Sprintf("mgr/%s/%s/server_addr", mgrModule, mgrConfig.DaemonID) cfgSetArgs = append(cfgSetArgs, cfgPath, opspec.ContainerEnvVarReference(podIPEnvVar)) if c.clusterInfo.CephVersion.IsAtLeastNautilus() { cfgSetArgs = append(cfgSetArgs, "--force")