Skip to content

Join load balancers

Emiliano Ticci edited this page Dec 5, 2013 · 1 revision

You can easily join a local load balancer using the following syntax:

config.vm.provider :softlayer do |sl|
  ...
  sl.join_load_balancer :vip => "1.1.1.1", :port => 443 do |service|
    service.destination_port = 443
    service.weight = 2
  end
end

The join_load_balancer directive takes some arguments and a block. Arguments are for service group configuration, instead the block is for service configuration.

NOTE:

You can't join load balancers from private-only machines.

Available service group parameters are:

Parameter Description Possible Values Default
:method Routing method Routing methods Round Robin
:port Virtual port Any port number
:type Routing type Routing types TCP
:vip Virtual IP address Any IP address

Available service parameters are:

Parameter Description Possible Values Default
:destination_port TCP port on the node Any port number
:health_check Service health check Health checks Ping
:weight Service weight 0-100 1

The directive can be specified multiple times for joining the machine to multiple load balancers/service groups.

Allocation of connections

Currently allocations are equally balanced between service groups. Service groups are created on the fly when necessary, and removed when empty.

Possible configuration values

Routing methods

  • Consistent Hash IP
  • Insert Cookie
  • Least Connections
  • Least Connections With Inserted Cookie
  • Least Connections With Persistent IP
  • Persistent IP
  • Round Robin
  • Round Robin With Inserted Cookie
  • Round Robin With Persistent IP
  • Shortest Response
  • Shortest Response With Inserted Cookie
  • Shortest Response With Persistent IP

Routing types

  • DNS
  • FTP
  • HTTP
  • HTTPS
  • TCP
  • UDP

Health checks

  • Default
  • DNS
  • HTTP
  • HTTP-Custom
  • Ping
  • TCP