[openstack-dev] Cells design issue
Armando Migliaccio
amigliaccio at vmware.com
Fri Jun 21 16:16:38 UTC 2013
In my view a cell should only know about the queue it's connected to, and
let the 'global' message queue to do its job of dispatching the messages to
the right recipient: that would solve the problem altogether.
Were federated <http://www.rabbitmq.com/federation.html> queues and topic
routing<http://blog.springsource.org/2011/04/01/routing-topologies-for-performance-and-scalability-with-rabbitmq/>not
considered fit for the purpose? I guess the drawback with this is that
it is tight to Rabbit.
On Mon, Jun 17, 2013 at 2:14 AM, Mark McLoughlin <markmc at redhat.com> wrote:
> On Fri, 2013-06-14 at 12:41 -0700, Chris Behrens wrote:
> > On Jun 13, 2013, at 11:26 PM, Mark McLoughlin <markmc at redhat.com> wrote:
> >
> > > Is there any reason not to just put it in nova.conf as transport URLs?
> > >
> > > (By nova.conf, I mean cfg.CONF for nova which means you could happily
> do
> > > e.g. --config-file nova-cells.conf too)
> >
> > The issue with using cfg.CONF is that we need the same config options
> > for each cell. So, I guess you'd have to dynamically create the
> > config groups with cell name as the group name… and have some sort of
> > global option or an option in a different config group that specifies
> > the list of cells. I think it just gets kinda nasty. But let me know
> > if I'm missing a good way to do it. It seems like JSON is going to be
> > a little more flexible. :)
>
> I don't know whether I like it yet or not, but here's how it might look:
>
> [cells]
> parents = parent1
> children = child1, child2
>
> [cell:parent1]
> transport_url = qpid://host1/nova
>
> [cell:child1]
> transport_url = qpid://host2/child1_nova
>
> [cell:child2]
> transport_url = qpid://host2/child2_nova
>
> Code for parsing that is:
>
> from oslo.config import cfg
>
> cells_opts = [
> cfg.ListOpt('parents', default=[]),
> cfg.ListOpt('children', default=[]),
> ]
>
> cell_opts = [
> cfg.StrOpt('api_url'),
> cfg.StrOpt('transport_url'),
> cfg.FloatOpt('weight_offset', default=0.0),
> cfg.FloatOpt('weight_scale', default=1.0),
> ]
>
> conf = cfg.CONF
> conf(['--config-file=cells.conf'])
> conf.register_opts(cells_opts, group='cells')
>
> def get_cell(conf, name):
> group_name = 'cell:' + name
> conf.register_opts(cell_opts, group=group_name)
> return conf[group_name]
>
> for cell in conf.cells.parents + conf.cells.children:
> print cell, get_cell(conf, cell).items()
>
>
> Ok ... I think I do like it :)
>
> Cheers,
> Mark.
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130621/d5d2bd45/attachment.html>
More information about the OpenStack-dev
mailing list