Re: Librados Keyring Issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It isn't possible in the config file. You have to do it via the rados constructor. You came to the correct conclusion.

On Mon, Aug 20, 2018, 2:59 AM Benjamin Cherian <benjamin.cherian@xxxxxxxxx> wrote:
Ok...after a bit more searching. I realized you can specify the username directly in the constructor of the "Rados" object. I'm still not entirely clear how one would do it through the config file, but this works for me as well.

import rados
cluster = rados.Rados(conffile="python_ceph.conf", rados_id="dms")
cluster.connect() # No exception when using keyring containing key for dms user!

Regards,

Benjamin Cherian

On Sun, Aug 19, 2018 at 9:55 PM, Benjamin Cherian <benjamin.cherian@xxxxxxxxx> wrote:
Hi David,

Thanks for the reply...I had thought there might be something simple like this, do you know what key I should use in the config file to specify the user? I didn't see anything related to user specification in the documentation.

Thanks,
Ben

On Sun, Aug 19, 2018 at 8:02 PM, David Turner <drakonstein@xxxxxxxxx> wrote:
You are not specifying which user you are using. Your config file specifies the keyring, but it's still trying to use the default user admin. If you specify that in your python you'll be good to go.

On Sun, Aug 19, 2018, 9:17 PM Benjamin Cherian <benjamin.cherian@xxxxxxxxx> wrote:
Hi,

I'm trying to write a simple test application using the Python 3 RADOS API. I've made a separate keyring for my application with the same permissions as the admin keyring, but I can't seem to use it to connect to my cluster. The only keyring that seems to work is the client.admin keyring. Does anyone have any experience with this issue?

Cluster info:
OS: Ubuntu 18.04.1
Ceph: Mimic 13.2.1 (from Ceph repository)

Attempting to connect to the cluster using python3-rados or python-rados results in the following error:

>>> import rados
>>> cluster = rados.Rados(conffile="python_ceph.conf")
>>> cluster.connect()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "rados.pyx", line 895, in rados.Rados.connect
  File "rados.pyx", line 474, in rados.make_ex
TypeError: InvalidArgumentError does not take keyword arguments

Contents of python_ceph.conf:

[global]
cluster network = 0.0.0.0/0
fsid = 518403a0-6b6f-42b8-be99-e58788bee5c2
mon host = <redacted>
mon initial members = <hostname of monitor>
mon_allow_pool_delete = True
osd crush chooseleaf type = 0
public network = 0.0.0.0/0

keyring = /etc/ceph/ceph.client.dms.keyring # Everything works ok if i use client.adming.keyring



Output of ceph auth ls 

...
client.admin
        key: <Redacted>
        caps: [mds] allow *
        caps: [mgr] allow *
        caps: [mon] allow *
        caps: [osd] allow *
...
client.dms
        key: <redacted, but matches contents of keyring file>
        caps: [mgr] allow *
        caps: [mon] allow *
        caps: [osd] allow *

...


What's even more odd is that I can use client.dms keyring with the ceph command line program without issues...
e.g., "ceph --user dms status" does not result in any errors has the same output as "ceph --user admin status"


Does anyone have any thoughts on what could be causing this issue?


Thanks,
Ben
_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com


_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux