Skip to content
Mercury Global Loadbalancer
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
cmd/mercury
docs
internal
pkg
test
tools
web/images
.gitignore
CHANGELOG.md
Gopkg.lock
Gopkg.toml
LICENSE
Makefile
README.md
VERSION

README.md

Codacy Badge CircleCI ReadTheDocs

Mercury

Mercury is a load balancer with Global Load balance capabilities across multiple Datacenter or Cloud infrastructures.

What is Mercury ?

Mercury is a Global load balancer, designed to add a dns based load balancing layer on top of its internal load balancer or 3rd party load balancers such as cloud services. This makes mercury able to load balance across multiple cloud environments using dns, while keeping existing cloud load balancing solutions in place.

Resources

Requirements

  • OSX
  • Linux (with iproute 3+)

Features

  • Global Load balancing across multiple datacenter or Cloud infrastructures using DNS based load balancing
  • Web GUI for viewing/managing your host state
  • Seamless configuration updates without interrupting connected clients
  • Does HealthChecks on local backends, and propagates their availability across other GLB instances
    • HTTP health checks (POST or GET)
    • TCP Connect checks (connects only)
    • TCP Data check (sends and/or expects data)
    • ICMP/UDP/TCP ping checks
    • None (always online)
  • Is a functional DNS server which provides GLB based replies with
    • Topology based load balancing, with predefined networks
    • Preference based load balancing, for active/passive setup
    • Round robin based load balancing for the most balanced setup
    • LeastConnected based load balancing for the host with the least connections
    • LeastTraffic based load balancing for the host with the least traffic
    • Response time based load balancing for the host with the quickest response time
    • Random based load balancing for when you can't choose
    • Sticky based load balancing for client sticky cookies
  • Is a full load balancer using the supported balancing methods
  • Supports automated Error / Maintenance pages
  • Includes checks for Nagios/Sensu to be used
  • Internal DNS server supports most record types
  • HTTP/2 support
  • Web-socket support

Installing

Linux

For Linux we can make a RHEL/Centos RPM package. To do so run the following:

$ make linux-package
$ rpm -i builds/packages/mercury-${version}.rpm

For other distributions:

$ make linux

OSX

OSX has no package, but you can run the following to create the binary:

$ make osx

Documentation

Documentation is are available at here

Examples configuration files are available at here

TLS & HTTP/2

a Full list of supported TLS cyphers in the golang tls.Config package is here

The recommended cyphers are:

Required for HTTP/2 is TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 see RFC

Note that this has to be the first cipher in the list!

HTTP/2 also requires CurveP256 to be supported

Web

You can browse to the web server within Mercury on the default url http://localhost:9001

Alternatively you can use curl to read the status

$ curl http://localhost:9001/backend
$ curl http://localhost:9001/glb

for json output pass the following option:

$ curl http://localhost:9001/backend -H 'Content-Type: application/json'

Checks

There are 2 checks which you can execute, and implement them in your monitoring system

Checking the Global Load balancing

$ mercury -config-file /etc/mercury/mercury.toml -check-glb

Checking the Backend nodes

$ mercury -config-file /etc/mercury/mercury.toml -check-backend

Contributing

  1. Clone this repository from GitHub:

     $ git clone git@github.com:schubergphilis/mercury.git
    
  2. Create a git branch

     $ git checkout -b my_bug_fix
    
  3. Install dependencies:

     $ make get
    
  4. Make your changes/patches/fixes, committing appropriately

  5. Write tests

  6. Run tests

     $ make test
    

License & Authors

    - Author: Ronald Doorn (<rdoorn@schubergphilis.com>)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You can’t perform that action at this time.