glber is a simple lightweight load balancer written in golang.
Go (>= 1.9)
go get github.com/hlts2/glber
Config file config.yml
describes configuration of load balancer.
The following is a setting example.
host: 0.0.0.0
port: 80
balancing: round-robin
tls:
enabled: true
cert_key: ./cert.key
key_key: ./key.key
servers:
- scheme: http
host: 192.168.33.11
port: 1111
- scheme: http
host: 192.168.33.11
port: 2222
- scheme: http
host: 192.168.33.11
There are three possible algorithms for balancing
Please write algorithm name in balancing
field of config.yml
file
balancing: round-robin # or ip-hash or least-connections
$ glber serve -s config.yml
$ glber --help
NAME:
glber - Load Balancer
USAGE:
glber [global options] command [command options] [arguments...]
VERSION:
v1.0.0
COMMANDS:
serve serve load balancer
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
$ glber serve --help
NAME:
glber serve - serve load balancer
USAGE:
glber serve [command options] [arguments...]
OPTIONS:
--set value, -s value set the configuration file (default: "config.yml")
- Helth check of service
glber released under MIT license, refer LICENSE file.