SDN
  • 1. 前言
  • 网络基础
    • 2. 网络基础理论
      • TCP/IP网络模型
      • ARP
      • ICMP
      • 路由
      • 交换机
      • UDP
      • DHCP/DNS
      • TCP
      • VLAN
      • Overlay
    • 3. Linux网络
      • Linux网络配置
        • 虚拟网络设备
      • iptables/netfilter
      • 负载均衡
      • 流量控制
      • SR-IOV
      • 内核VRF
      • eBPF
        • bcc
        • 故障排查
      • XDP
        • XDP架构
        • 使用场景
      • 常用工具
        • 网络抓包tcpdump
        • scapy
      • 内核网络参数
    • 4. Open vSwitch
      • OVS介绍
      • OVS编译
      • OVS原理
      • OVN
        • OVN编译
        • OVN实践
        • OVN高可用
        • OVN Kubernetes插件
        • OVN Docker插件
        • OVN OpenStack
    • 5. DPDK
      • DPDK简介
      • DPDK安装
      • 报文转发模型
      • NUMA
      • Ring和共享内存
      • PCIe
      • 网卡性能优化
      • 多队列
      • 硬件offload
      • 虚拟化
      • OVS DPDK
      • SPDK
      • OpenFastPath
  • SDN&NFV
    • 6. SDN
      • SDN控制器
        • OpenDaylight
        • ONOS
        • Floodlight
        • Ryu
        • NOX/POX
      • 南向接口
        • OpenFlow
        • OF-Config
        • NETCONF
        • P4
      • 数据平面
    • 7. NFV
    • 8. SDWAN
  • 容器网络
    • 9. 容器网络
      • Host 网络
      • CNI
        • CNI介绍
        • Flannel
        • Calico
        • Weave
        • Cilium
        • OVN
        • Contiv
        • SR-IOV
        • Romana
        • OpenContrail
        • Kuryr
      • CNM
        • CNM介绍
        • Calico
        • Contiv
        • Romana
        • SR-IOV
      • Kubernetes网络
  • SDN实践
    • 10. Mininet
    • 11. SDN实践案例
      • Goolge网络
  • 参考文档
    • 12. FAQ
    • 13. 参考文档
由 GitBook 提供支持
在本页
  • Active-Backup
  • Active-Active
  1. 网络基础
  2. 4. Open vSwitch
  3. OVN

OVN高可用

上一页OVN实践下一页OVN Kubernetes插件

最后更新于6年前

目前,OVS支持主从模式的高可用。

Active-Backup

在启动ovsdb-server时,可以设置:

Syncing Options

   The following options allow ovsdb-server to synchronize  its  databases
   with another running ovsdb-server.

   --sync-from=server
          Sets up ovsdb-server to synchronize its databases with the data‐
          bases  in  server,  which must be an active connection method in
          one of the forms documented in ovsdb-client(1).  Every  transac‐
          tion  committed  by  server  will be replicated to ovsdb-server.
          This option makes ovsdb-server start as  a  backup  server;  add
          --active to make it start as an active server.

   --sync-exclude-tables=db:table[,db:table]...
          Causes the specified tables to be excluded from replication.

   --active
          By  default, --sync-from makes ovsdb-server start up as a backup
          for server.  With --active, however, ovsdb-server starts  as  an
          active  server.  Use this option to allow the syncing options to
          be specified using command line options, yet start  the  server,
          as  the default, active server.  To switch the running server to
          backup mode, use ovs-appctl(1) to execute the  ovsdb-server/con‐
          nect-active-ovsdb-server command.

注意,这里的配置是静态的,主ovsdb-server出现问题时,从并不会自动恢复。这时可以借助Pacemaker来实现自动故障恢复:

After creating a pacemaker cluster, use the following commands to create one active and multiple backup servers for OVN databases:

$ pcs resource create ovndb_servers ocf:ovn:ovndb-servers \
     master_ip=x.x.x.x \
     ovn_ctl=<path of the ovn-ctl script> \
     op monitor interval="10s" \
     op monitor role=Master interval="15s"
$ pcs resource master ovndb_servers-master ovndb_servers \
    meta notify="true"

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:

$ pcs resource create VirtualIP ocf:heartbeat:IPaddr2 ip=x.x.x.x \
    op monitor interval=30s
$ pcs constraint order promote ovndb_servers-master then VirtualIP
$ pcs constraint colocation add VirtualIP with master ovndb_servers-master \
    score=INFINITY

Active-Active

OVN控制平面的Active-Active高可用还在开发中,预计会借鉴etcd的方式,基于Raft算法实现。

主从同步的实现方法可见。

主从同步选项
OVSDB Replication Implementation
https://github.com/blp/ovs-reviews/tree/raft3
http://docs.openvswitch.org/en/latest/topics/high-availability/
http://galsagie.github.io/2015/08/03/df-distributed-db/