Skip to content

Enabling round-robin failover with failback #273

@emollusion

Description

@emollusion

What section to enhance

failover
Round Robin Load Balancing

Description of the problem

It would be nice to clarify how to use failover with failback to enable a round robin loadbalancing with failover.
Reading the sections separately gives the impression that this is not done, so a guide on how to do this since it is possible would be a nice addition.

Proposed solution

Addding a failover for each destination in the loadbalancing, including the next server(s) together with failback enables loadbalancing between multiple servers. In the below example two destinations are used, so when one of them goes offline all traffic goes to the other, and when both are online the traffic is balanced as normal.

This should be possible to do with any amount of destinations I have however only tested it with two so far.

Config Example for Destination

destination d_syslog_udp {
  channel {
    channel {
      filter {
        "0" == "$(% ${R_MSEC} 2)"
      };
      destination {
        network(
          "first-server.com"
          port(514)
          transport(udp)
          spoof-source(yes)
          spoof-source-max-msglen(1024)
          failover(
            servers("second-server.com")
            failback(
              successful-probes-required(3)
              tcp-probe-interval(60)
            )
          )
        );
      };
      flags(final);
    };

    channel {
      filter {
        "1" == "$(% ${R_MSEC} 2)"
      };
      destination {
        network(
          "second-server.com"
          port(514)
          transport(udp)
          spoof-source(yes)
          spoof-source-max-msglen(1024)
          failover(
            servers("first-server.com")
            failback(
              successful-probes-required(3)
              tcp-probe-interval(60)
            )
          )
        );
      };
      flags(final);
    };

  };
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions