OVN高可用
目前,OVS支持主从模式的高可用。
Active-Backup
在启动ovsdb-server时,可以设置主从同步选项:
注意,这里的配置是静态的,主ovsdb-server出现问题时,从并不会自动恢复。这时可以借助Pacemaker来实现自动故障恢复:
After creating a pacemaker cluster, use the following commands to create one active and multiple backup servers for OVN databases:
The master_ip
and ovn_ctl
are the parameters that will be used by the OCF script.
ovn_ctl
is optional, if not given, it assumes a default value of /usr/share/openvswitch/scripts/ovn-ctl.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. You can add the optional parameters ‘nb_master_port’, ‘nb_master_protocol’, ‘sb_master_port’, ‘sb_master_protocol’ to set the protocol and port.
Whenever the active server dies, pacemaker is responsible to promote one of the backup servers to be active. Both ovn-controller and ovn-northd needs the ip-address at which the active server is listening. With pacemaker changing the node at which the active server is run, it is not efficient to instruct all the ovn-controllers and the ovn-northd to listen to the latest active server’s ip-address.
This problem can be solved by using a native ocf resource agent ocf:heartbeat:IPaddr2. The IPAddr2 resource agent is just a resource with an ip-address. When we colocate this resource with the active server, pacemaker will enable the active server to be connected with a single ip-address all the time. This is the ip-address that needs to be given as the parameter while creating the ovndb_servers resource.
Use the following command to create the IPAddr2 resource and colocate it with the active server:
主从同步的实现方法可见OVSDB Replication Implementation。
Active-Active
OVN控制平面的Active-Active高可用还在开发中,预计会借鉴etcd的方式,基于Raft算法实现。
最后更新于