From patchwork Thu May 19 11:17:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Serong X-Patchwork-Id: 9126461 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5CF9CBF29F for ; Thu, 19 May 2016 11:17:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 825FA20172 for ; Thu, 19 May 2016 11:17:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 03C0520142 for ; Thu, 19 May 2016 11:17:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754140AbcESLRz (ORCPT ); Thu, 19 May 2016 07:17:55 -0400 Received: from prv3-mh.provo.novell.com ([137.65.250.26]:44052 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753908AbcESLRy (ORCPT ); Thu, 19 May 2016 07:17:54 -0400 Received: from [192.168.4.162] (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (TLS encrypted); Thu, 19 May 2016 05:17:51 -0600 Subject: Re: Update on ceph-mgr To: John Spray , Ceph Development References: From: Tim Serong Message-ID: <573DA0DB.30203@suse.com> Date: Thu, 19 May 2016 21:17:47 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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=/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 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;