digitalocean / ceph_exporter

Prometheus exporter that scrapes meta information about a ceph cluster.
Apache License 2.0
405 stars 145 forks source link

Connecting to ceph reports ret=-22, Invalid argument #251

Closed molinso-ma closed 4 months ago

molinso-ma commented 4 months ago

Why does it report ret=-22, Invalid argument when I use the v4.2.3 mirror to connect to ceph? My ceph version is 17.2.3

My configuration is as follows: /etc/ceph/ceph.conf: [global] fsid = fe9adb68-04b8-465b-aa37-dc56401ac70a mon_initial_members = a, b, c mon_host = 172..0.248:6789,172..0.254:6789,172..0.244:6789 auth_cluster_required = cephx auth_service_required = cephx auth_client_required = cephx public network = 172..0.224/27

[client.admin] keyring = /etc/ceph/keyring

/etc/ceph/keyring: [client.admin] key = AQAfIFtm***+1llMY5A== caps mds = "allow " caps mgr = "allow " caps mon = "allow " caps osd = "allow "

env: CEPH_CLUSTER: rook-ceph

I can connect to ceph with this command: rados df --conf /etc/ceph/ceph.conf --name client.admin --keyring /etc/ceph/keyring But with the same configuration, ceph-exporter cannot connect to ceph, reporting Invalid argument error.

diffs commented 4 months ago

This might be a long shot, but do you have a newline (as in, a line break) at the end of your ceph.conf and keyring files? You'll want to have one.

diffs commented 4 months ago

Additionally, you can try adjusting the CEPH_USER environment variable (which is read by ceph_exporter), perhaps trying both admin and client.admin to see if one of them works. Also ceph auth ls on your cluster to make sure the keyring is actually installed and has the right caps.

molinso-ma commented 4 months ago

This might be a long shot, but do you have a newline (as in, a line break) at the end of your ceph.conf and keyring files? You'll want to have one.

Thank you very much. My configuration file is indeed missing a line break. It works fine after adding a line break.

diffs commented 4 months ago

👍 Glad we could get that figured out!