前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ceph admin keyring丢失fix​

ceph admin keyring丢失fix​

作者头像
用户1260683
发布2019-11-06 17:00:39
2.5K0
发布2019-11-06 17:00:39
举报

ceph admin keyring丢失fix

故障描述

之前部署的环境未按标准操作,Mon服务起来了,但是未保存keyring,执行命令的时候提示keyring找不到,于是有了这篇文章。

具体操作

确认keyring丢失,但是mon服务存活

代码语言:javascript
复制
[root@localhost cluter]# ceph -s
2019-08-23 03:32:48.374297 7fe9cfcc4700 -1 auth: unable to find a keyring on /etc/ceph/ceph.client.admin.keyring,/etc/ceph/ceph.keyring,/etc/ceph/keyring,/etc/ceph/keyring.bin,: (2) No such file or directory
2019-08-23 03:32:48.374308 7fe9cfcc4700 -1 monclient: ERROR: missing keyring, cannot use cephx for authentication
2019-08-23 03:32:48.374309 7fe9cfcc4700  0 librados: client.admin initialization error (2) No such file or directory
[errno 2] error connecting to the cluster

[root@localhost cluter]# ls /etc/ceph/
ceph.conf  rbdmap  tmpFLL2nW  tmpwcDbve


[root@localhost cluter]# ps axu|grep mon
dbus         644  0.0  0.2  98476  2144 ?        Ssl  01:10   0:00 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root         679  0.0  0.8 695184  9096 ?        Ssl  01:10   0:00 /usr/sbin/NetworkManager --no-daemon
ceph        2734  0.0  2.8 409176 28660 ?        Ssl  03:32   0:00 /usr/bin/ceph-mon -f --cluster ceph --id localhost --setuser ceph --setgroup ceph
root        2922  0.0  0.0 112708   984 pts/0    R+   03:39   0:00 grep --color=auto mon

修复就一条命令,如下

代码语言:javascript
复制
[root@localhost cluter]# /usr/bin/ceph --connect-timeout=25 --cluster=ceph --name mon. --keyring=/var/lib/ceph/mon/ceph-localhost/keyring auth get-or-create client.admin osd 'allow *' mon 'allow *' mds 'allow *' > /etc/ceph/ceph.client.admin.keyring
[root@localhost cluter]# ceph -s
  cluster:
    id:     25d59c28-01b8-435a-a28a-1215d6989376
    health: HEALTH_OK

  services:
    mon: 1 daemons, quorum localhost
    mgr: no daemons active
    osd: 0 osds: 0 up, 0 in

  data:
    pools:   0 pools, 0 pgs
    objects: 0 objects, 0B
    usage:   0B used, 0B / 0B avail
    pgs:

[root@localhost cluter]# cat /etc/ceph/ceph.client.admin.keyring
[client.admin]
    key = AQBkl19d7s9hGxAARyleINJggH9sA6aunSkTLg==
本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2019-09-28,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 Ceph对象存储方案 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • ceph admin keyring丢失fix
    • 故障描述
      • 具体操作
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档