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>
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;