ceph报错librados: client.admin authentication error (1) Operation not permitted

…衆ロ難τιáo~ 提交于 2019-11-30 18:55:50
执行:ceph -s
2019-10-08 13:52:46.535872 7fb77dc6e700  0 librados: client.admin authentication error (1) Operation not permitted
Error connecting to cluster: PermissionError
[root@node2 ceph]# ceph -s
2019-10-08 15:40:25.631076 7f5f2158c700  0 librados: client.admin authentication error (13) Permission denied
Error connecting to cluster: PermissionDeniedError
[root@node2 ceph]#

 

》(1)ceph -s的完整命令是:
ceph -s --conf /etc/ceph/ceph.conf --name client.admin --keyring /etc/ceph/ceph.client.admin.keyring
说明此时client.admin使用的key跟monitor记录的key不同。
此时可用monitor查询ceph -s,命令如下:
ceph -s --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring  

(2)在montor上查询key:

ceph -s --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring  #查询monitor的key
ceph auth get client.admin --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring   #查询client的key
[root@node2 ceph]# ceph auth get client.admin --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring
exported keyring for client.admin
[client.admin]
        key = AQCSJJxdFjCEORAAMv2j2dtkqswcW1BYfh2H2A==
[root@node2 ceph]#

(3)将查询到的client命令写入:/etc/ceph/ceph.client.admin.keyring文件,并增加"r"权限:

[root@node2 ceph]# cat /etc/ceph/ceph.client.admin.keyring 
[client.admin]
        key = AQCSJJxdFjCEORAAMv2j2dtkqswcW1BYfh2H2A==
        caps mds = "allow *"
        caps mon = "allow *"
        caps osd = "allow *"
[root@node2 ceph]# 
[root@node2 ceph]# ll /etc/ceph/ceph.client.admin.keyring  
-rw-r--r-- 1 root root 129 Oct  8 14:58 /etc/ceph/ceph.client.admin.keyring
[root@node2 ceph]# 

(4)执行ceph -s,若还报错,则使用mon用户会client增加权限:

ceph -n mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring auth caps client.admin mds 'allow *' osd 'allow *' mon 'allow *'

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!