On Tue, 23 Jul 2013, Gregory Farnum wrote:
> On Tue, Jul 23, 2013 at 8:50 AM, Guido Winkelmann
> <[email protected]> wrote:
> > Hi,
> >
> > How can I get a list of all defined monitors in a ceph cluster from a client
> > when using the C API?
> >
> > I need to store the monitors for available ceph clusters in a database, and
> > I
> > would like to build this software so that a) the administrator has to enter
> > only one of the monitor addresses and the software will automatically fetch
> > the rest once it can reach the cluster and b) the software will notice if
> > the
> > list of monitors changes in any way and automatically update its database.
>
> Hmm, I don't know that there is a C interface for this. You can get
> the information out of "ceph mon status" or similar (and formatted in
> json for easy parsing). Dan's been working on making an API for all
> those monitor commands but I'm not sure where it is in terms of
> external usability.
They are in 0.66 and the about-to-be-announced 0.67-rc1:
int rados_mon_command(rados_t cluster, const char **cmd, size_t cmdlen,
const char *inbuf, size_t inbuflen,
char **outbuf, size_t *outbuflen,
char **outs, size_t *outslen);
and you probably want to do a 'mon dump', where cmd[0] = '{"prefix": "mon
dump"}' and cmdlen == 1. You'll get a json result in outbuf, same as the
'ceph mon dump' command.
sage
_______________________________________________
ceph-users mailing list
[email protected]
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com