Hi Han,

Please see below for inline comments

On Wed, May 9, 2018 at 5:17 AM, Han Zhou <zhou...@gmail.com> wrote:

> Hi Babu/Numan,
>
> I have a question regarding OVN pacemaker OCF script.
> I see in the script MASTER_IP is used to start the active DB and standby
> DBs will use that IP to sync from.
>
> In the Documentation/topics/integration.rst it is also mentioned:
>
> `master_ip` is the IP address on which the active database server is
> expected to be listening, the slave node uses it to connect to the master
> node.
>
> However, since active node will change after failover, I wonder if we
> should provide all the IPs of each nodes, and let pacemaker to decide which
> IP is the master IP to be used, dynamically.
>



> I see in the documentation it is mentioned about using the IPAddr2
> resource for virtual IP. Does it indicate that we should use the virtual IP
> as the master IP?
>

That is true. If the master ip is not virtual ip, then we will not be able
to figure out which is the master node. We need to configure networking-ovn
and ovn-controller to point to the right master node so that they can do
write transactions on the DB.

Below is how we have configured pacemaker OVN HA dbs in tripleo openstack
deployment

 - Tripleo deployment creates many virtual IPs (using IPAddr2) and these IP
addresses are frontend IPs for keystone and all other openstack API
services and haproxy is used to load balance the traffic (the deployment
will mostly have 3 controllers and all the openstack API services will be
running on each node).

 - We choose one of the IPaddr2 virtual ip and we set a colocation
constraint when creating the OVN pacemaker HA db resource i.e we ask
pacemaker to promote the ovsdb-servers running in the node configured with
the virtual ip (i.e master_ip).  Pacemaker will call the promote action [1]
on the node where master ip is configured.

- tripleo configures "ovn_nb_connection=tcp:VIP:6641" and "
ovn_sb_connection=tcp:VIP:6642" in neutron.conf and runs "ovs-vsctl set
open . external_ids:ovn-remote=tcp:VIP:6642" on all the nodes where
ovn-controller service is started.

- Suppose the master ip node goes down for some reason. Pacemaker detects
this and moves the virtual ip IPAddr2 resource to another node and promotes
the ovsdb-servers running on that node to master. This way, the
neutron-servers and ovn-controlloers can still talk to the same IP without
even noticing that other node becoming master.



Since tripleo was using the IPaddr2 model, we thought this would be the
better way to have a master/slave HA for ovsdb-servers.

However, this may not work in all scenarios, since the virtual IP works
> only if it can be routed to all nodes, e.g. when all nodes are on the same
> subnet.
>

You mean you want to create a pacemaker cluster with nodes belonging to
different subnets ? I had a chat with the pacemaker folks and this is
possible. You can also create a IPAddr2 resource. Pacemaker doesn't put any
restrictions. But you need to solve the  reachability of that ip from all
the networks/nodes.

In those cases the IPAddr2 virtual IP won't work. In those cases, for the
> clients to access the DB, we can use Load-Balancer VIP. But the problem is
> still how to set the master_ip and how to make the standby to connect to
> the new active after failover.
>

I am a bit confused here. Your setup will still have the pacemaker cluster
right ? Are you talking about having OVN db servers active/passive setup on
a non pacemaker cluster setup ? If so, I don't think the OVN OCF script can
be used and you have to solve it differently. Correct me if I am wrong here.

You mentioned above "However, since active node will change after failover,
I wonder if we should provide all the IPs of each nodes, and let pacemaker
to decide which IP is the master IP to be used, dynamically".

We can definitely add this support. Whenever pacemaker promotes a node,
other nodes come to know about it and OVN OCF script can configure the
ovsdb-servers on the slave nodes to connect to the new master. But how will
you configure the neutron-server and ovn-controllers to talk to the new
master ?
Are you planning to use load balancer IP for this purpose ? What if the
load balancer ip resolves to a standby server ?

Hope this helps.

If you have a requirement to support this scenario (i.e without master_ip
param), it can be done. But care should be taken when implementing it.


[1] -
https://github.com/openvswitch/ovs/blob/master/ovn/utilities/ovndb-servers.ocf#L505
       http://www.linux-ha.org/doc/dev-guides/_resource_agent_actions.html



> I may have missed something here. Could you help explain what's the
> expected way to work?
>




>
> Thanks,
> Han
>
_______________________________________________
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to