diff mbox

Update on ceph-mgr

Message ID 573DA0DB.30203@suse.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tim Serong May 19, 2016, 11:17 a.m. UTC
On 05/18/2016 09:02 PM, John Spray wrote:
> Hi all,
> 
> For those who are interested, I wanted to give a quick update on the
> recently-started ceph-mgr work.  This is all still very changeable,
> but now that some code exists I'm putting it out there.
> 
> Firstly, here it is: https://github.com/jcsp/ceph/tree/wip-ceph-mgr
> 
> [...]
> 
> To play with this:
>  1. Build your tree with cmake
>  2. make ceph-mgr
>  3. CALAMARI_CONFIG=<whereever>/ceph/src/pybind/mgr/calamari.conf
> PYTHONPATH=env/lib/python2.7/site-packages bin/ceph-mgr -f
>  4. Point your browser at e.g.
> http://localhost:8002/api/v2/cluster/osd and witness that you get
> calamari-like API output

Just for fun, I decided to play.  I built from a clone of your
wip-ceph-mgr branch, then grabbed a ceph.conf and admin keyring from an
existing Jewel cluster, dumped them in build/, and ran:

PYTHONPATH=../src/pybind/mgr
CALAMARI_CONFIG=../src/pybind/mgr/calamari.conf ./bin/ceph-mgr
--keyring=./ceph.client.admin.keyring --log-file=client.log

This immediately aborted with an assertion failure:

  /ceph/src/mgr/Mgr.cc: 241: FAILED assert(mds_cmd.r == 0)

I suspect the "mds metadata" command might want an MDS name.  Throwing
caution to the wind I commented out that assert, and the mon_cmd.r
assert as well (see attached patch), and got a bit further, but then it
failed with:

  ImportError: No module named rest_framework

TL;DR: I had to install pythond-datetime, django 1.8 and
djangorestframework.  The latter I let be the latest version available
via `pip install` (3.3.3).

I had earlier tried Django 1.9, which I randomly happened to have
installed, but that failed with:

RuntimeError(u"Model class django.contrib.auth.models.Permission doesn't
declare an explicit app_label and isn't in an application in
INSTALLED_APPS.",)

(Django 1.6 is no good either, BTW: AttributeError: 'module' object has
no attribute 'UUIDField')

Anyway, after all that, I can in fact get a nice looking chunk of JSON
out of http://localhost:8002/api/v2/cluster/osd :)

Regards,

Tim

Comments

John Spray May 19, 2016, 11:40 a.m. UTC | #1
On Thu, May 19, 2016 at 12:17 PM, Tim Serong <tserong@suse.com> wrote:
> On 05/18/2016 09:02 PM, John Spray wrote:
>> Hi all,
>>
>> For those who are interested, I wanted to give a quick update on the
>> recently-started ceph-mgr work.  This is all still very changeable,
>> but now that some code exists I'm putting it out there.
>>
>> Firstly, here it is: https://github.com/jcsp/ceph/tree/wip-ceph-mgr
>>
>> [...]
>>
>> To play with this:
>>  1. Build your tree with cmake
>>  2. make ceph-mgr
>>  3. CALAMARI_CONFIG=<whereever>/ceph/src/pybind/mgr/calamari.conf
>> PYTHONPATH=env/lib/python2.7/site-packages bin/ceph-mgr -f
>>  4. Point your browser at e.g.
>> http://localhost:8002/api/v2/cluster/osd and witness that you get
>> calamari-like API output
>
> Just for fun, I decided to play.  I built from a clone of your
> wip-ceph-mgr branch, then grabbed a ceph.conf and admin keyring from an
> existing Jewel cluster, dumped them in build/, and ran:
>
> PYTHONPATH=../src/pybind/mgr
> CALAMARI_CONFIG=../src/pybind/mgr/calamari.conf ./bin/ceph-mgr
> --keyring=./ceph.client.admin.keyring --log-file=client.log
>
> This immediately aborted with an assertion failure:
>
>   /ceph/src/mgr/Mgr.cc: 241: FAILED assert(mds_cmd.r == 0)

Yeah, you're not in general going to be able to run this against an
older-versioned Ceph cluster; there are already mon changes (such as
improving the metadata commands) and there will also be more extensive
additions to all the services to enable them to talk to the mgr.  This
is going to be new functionality all around, as opposed to a new thing
that can sit on older clusters.

> I suspect the "mds metadata" command might want an MDS name.  Throwing
> caution to the wind I commented out that assert, and the mon_cmd.r
> assert as well (see attached patch), and got a bit further, but then it
> failed with:
>
>   ImportError: No module named rest_framework
>
> TL;DR: I had to install pythond-datetime, django 1.8 and
> djangorestframework.  The latter I let be the latest version available
> via `pip install` (3.3.3).
>
> I had earlier tried Django 1.9, which I randomly happened to have
> installed, but that failed with:
>
> RuntimeError(u"Model class django.contrib.auth.models.Permission doesn't
> declare an explicit app_label and isn't in an application in
> INSTALLED_APPS.",)
>
> (Django 1.6 is no good either, BTW: AttributeError: 'module' object has
> no attribute 'UUIDField')
>
> Anyway, after all that, I can in fact get a nice looking chunk of JSON
> out of http://localhost:8002/api/v2/cluster/osd :)

Awesome!

John

>
> Regards,
>
> Tim
> --
> Tim Serong
> Senior Clustering Engineer
> SUSE
> tserong@suse.com
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/mgr/Mgr.cc b/src/mgr/Mgr.cc
index e8e17b5..73df961 100644
--- a/src/mgr/Mgr.cc
+++ b/src/mgr/Mgr.cc
@@ -238,10 +238,10 @@  void Mgr::load_all_metadata()
   osd_cmd.wait();
   mon_cmd.wait();
 
-  assert(mds_cmd.r == 0);
-  assert(mon_cmd.r == 0);
+//  assert(mds_cmd.r == 0);
+//  assert(mon_cmd.r == 0);
   assert(osd_cmd.r == 0);
-
+/*
   for (auto &metadata_val : mds_cmd.json_result.get_array()) {
     json_spirit::mObject daemon_meta = metadata_val.get_obj();
 
@@ -277,7 +277,7 @@  void Mgr::load_all_metadata()
 
     dmi.insert(dm);
   }
-
+*/
   for (auto &osd_metadata_val : osd_cmd.json_result.get_array()) {
     json_spirit::mObject osd_metadata = osd_metadata_val.get_obj();
     dout(4) << osd_metadata.at("hostname").get_str() << dendl;