cephfs:報錯librados: client.admin authentication error (1) Operation not permitted


執行: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 *'
 
(5)此操作后,數據會丟失
[root@node2 ceph]# ceph -s
    cluster 4c137c64-9e09-410e-aee4-c04b0f46294e
     health HEALTH_ERR
            64 pgs are stuck inactive for more than 300 seconds
            64 pgs stuck inactive
            64 pgs stuck unclean
            no osds
     monmap e3: 1 mons at {node2=172.16.18.22:6789/0}
            election epoch 28, quorum 0 node2
     osdmap e1: 0 osds: 0 up, 0 in
            flags sortbitwise,require_jewel_osds
      pgmap v2: 64 pgs, 1 pools, 0 bytes data, 0 objects
            0 kB used, 0 kB / 0 kB avail
                  64 creating
[root@node2 ceph]# 
[root@node2 ceph]# 
[root@node2 ceph]# ceph osd tree
ID WEIGHT TYPE NAME    UP/DOWN REWEIGHT PRIMARY-AFFINITY 
-1      0 root default                                   
[root@node2 ceph]# 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM