]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: register daemon in service map with more details 39380/head
authorSébastien Han <seb@redhat.com>
Tue, 9 Feb 2021 16:24:48 +0000 (17:24 +0100)
committerSébastien Han <seb@redhat.com>
Mon, 15 Feb 2021 16:28:58 +0000 (17:28 +0100)
From now on, the rgw daemon will register in the service map with
RADOS client ID. This will give us better visibility when
query the Ceph status and also will also us to run multiple rgws with
the same cephX user AND to be displayed individually. Previously, using a
single cephX user to run multiple gateways was possible but the Ceph
status would display a single rgw.
Also, in the same situation it will allow us to gather metrics and
export them through the ceph-mgr Prometheus exporter.

Fixes: https://tracker.ceph.com/issues/49227
Signed-off-by: Sébastien Han <seb@redhat.com>
src/rgw/rgw_rados.cc

index 9c66c3dc67251d261002589dad54267d77b8291c..98e24e930a0112fccd1f4f798a5d8d83823999eb 100644 (file)
@@ -1136,7 +1136,9 @@ int RGWRados::register_to_service_map(const string& daemon_type, const map<strin
   if (name.compare(0, 4, "rgw.") == 0) {
     name = name.substr(4);
   }
-  int ret = rados.service_daemon_register(daemon_type, name, metadata);
+  std::string instance_id = stringify(rados.get_instance_id());
+  std::string rgw_service_map_name = name + "." + instance_id;
+  int ret = rados.service_daemon_register(daemon_type, rgw_service_map_name, metadata);
   if (ret < 0) {
     ldout(cct, 0) << "ERROR: service_daemon_register() returned ret=" << ret << ": " << cpp_strerror(-ret) << dendl;
     return ret;