[openstack-dev] [Neutron] [Dragonflow] Support configuration of DB clusters

Gal Sagie gal.sagie at gmail.com
Mon Dec 28 12:04:38 UTC 2015


Hi Li Ma,

I think its a good idea.
I suggest for first stage, pass the CONF as optional parameter in addition
to the db_ip and db_port.
This way you will have minimum code changes at first patch.

If we see its working ok, we can later remove db_ip and db_port and adjust
the other
drivers in another patch.

Thanks
Gal.


On Mon, Dec 28, 2015 at 9:48 AM, Li Ma <skywalker.nick at gmail.com> wrote:

> My intention is to pass db-host-list (maybe it is defined in the conf
> file) to db backend drivers. I find that there's '**args' available
> [1], but it seems not working due to [2].
>
> I suggest to use a simpler method to allow user-defined configuration that
> is
> removing db_ip and db_port parameters and directly passing cfg.CONF
> object to db backend driver.
>
> In db_api.py, it should be:
> def initialize(self, config):
>     self.config = config
>
> In api_nb.py, it should be:
> def initialize(self):
>         self.driver.initialize(cfg.CONF) <-- from oslo_config
>
> As a result, let db backend developers choose which parameter to use.
>
> [1]
> https://github.com/openstack/dragonflow/blob/master/dragonflow/db/db_api.py#L21
> [2]
> https://github.com/openstack/dragonflow/blob/master/dragonflow/db/api_nb.py#L74-L75
>
> On Mon, Dec 28, 2015 at 9:12 AM, shihanzhang <ayshihanzhang at 126.com>
> wrote:
> >
> > good suggestion!
> >
> >
> > At 2015-12-25 19:07:10, "Li Ma" <skywalker.nick at gmail.com> wrote:
> >>Hi all, currently, we only support db_ip and db_port in the
> >>configuration file. Some DB SDK supports clustering, like Zookeeper.
> >>You can specify a list of nodes when client application starts to
> >>connect to servers.
> >>
> >>I'd like to implement this feature, specifying ['ip1:port',
> >>'ip2:port', 'ip3:port'] list in the configuration file. If only one
> >>server exists, just set it to ['ip1:port'].
> >>
> >>Any suggestions?
> >>
> >>--
> >>
> >>Li Ma (Nick)
> >>Email: skywalker.nick at gmail.com
> >>
>
> >>__________________________________________________________________________
> >>OpenStack Development Mailing List (not for usage questions)
> >>Unsubscribe:
> OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> >>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> >
> >
> >
> >
> >
> >
> >
> __________________________________________________________________________
> > OpenStack Development Mailing List (not for usage questions)
> > Unsubscribe:
> OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> >
>
>
>
> --
>
> Li Ma (Nick)
> Email: skywalker.nick at gmail.com
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



-- 
Best Regards ,

The G.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20151228/7829673c/attachment.html>


More information about the OpenStack-dev mailing list