当尝试在名为“ceph”的通用 ceph 集群上运行 ceph-rest-api 时,它可以在 cli 中正常工作:
/bin/ceph-rest-api --cluster ceph --id admin
* Running on http://0.0.0.0:5000/
但是,当我尝试在名为“test”的测试集群上运行它时,它会出错:
/bin/ceph-rest-api --cluster test --id test
Traceback (most recent call last):
File "/bin/ceph-rest-api", line 59, in <module>
rest,
File "/usr/lib/python2.7/site-packages/ceph_rest_api.py", line 495, in generate_app
addr, port = api_setup(app, conf, cluster, clientname, clientid, args)
File "/usr/lib/python2.7/site-packages/ceph_rest_api.py", line 106, in api_setup
app.ceph_cluster.connect()
File "rados.pyx", line 785, in rados.Rados.connect (rados.c:8969)
rados.ObjectNotFound: error connecting to the cluster
我也尝试过使用变体并得到不同的错误:
/bin/ceph-rest-api --cluster test --name test
Traceback (most recent call last):
File "/bin/ceph-rest-api", line 59, in <module>
rest,
File "/usr/lib/python2.7/site-packages/ceph_rest_api.py", line 495, in generate_app
addr, port = api_setup(app, conf, cluster, clientname, clientid, args)
File "/usr/lib/python2.7/site-packages/ceph_rest_api.py", line 104, in api_setup
app.ceph_cluster = rados.Rados(name=clientname, conffile=conf)
File "rados.pyx", line 525, in rados.Rados.__init__ (rados.c:5719)
File "rados.pyx", line 425, in rados.requires.wrapper.validate_func (rados.c:4106)
File "rados.pyx", line 557, in rados.Rados.__setup (rados.c:6237)
rados.Error: rados_initialize failed with error code: -22
对我做错的任何帮助将不胜感激。