Skip to content
forked from luizbafilho/fusis

Fusis Balancer is a dynamic Layer 4 Load Balancer powered by IPVS and Serf.

License

Notifications You must be signed in to change notification settings

aitherios/fusis

 
 

Repository files navigation

Fusis Balancer Build Status

Fusis Balancer is a software Layer 4 Load Balancer powered by Linux's IPVS. It exposes a HTTP API to manage your services dynamically.

A layer 3 balancer take decisions based only on IP address (source and destination), a layer 4 balancer can also see transport information like TCP and UDP ports. Being a software balancer, it's tailored to be easy to deploy and scale.

Why?

The goal of this project is to provide a friendly way to use IPVS.

It will be responsible for detecting new/failed nodes and add/remove routes to them automatically configuring the network to do so.

State

This project it's under heavy development, it's not usable yet, but you can Star ⭐ the project and follow the updates.

Dependencies

  • Linux kernel >= 2.6.10 or with IPVS module installed
  • libnl 3.X

Quick Start

WIP

Developing

VM setup with Vagrant

  1. Install Vagrant

  2. Build the VM

vagrant up

Watch the message at the end of vagrant provision process. It'll provide you with user, password and where the project code is.

Linux setup

  1. Install Go 1.6 or later

  2. Install libnl-3 (Debian based: apt-get install libnl-3-dev libnl-genl-3-dev)

  3. Get this project into $GOPATH:

go get -v github.com/luizbafilho/fusis

Running the project

Now that you have IPVS and fusis installed, run the project:

# Remember, fusis binary is at $GOPATH/bin/fusis, add it to your $PATH
sudo fusis balancer --bootstrap

You should see something like: [GIN-debug] Listening and serving HTTP on :8000

From another host, send a HTTP request to the API querying for available services available:

curl -i {IP OF FUSIS HOST}:8000/services

And you should get:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Thu, 07 Apr 2016 21:23:18 GMT
Content-Length: 3

[]

Just for testing purposes, lets add a route to a fake IPv4 by runnging this on the fusis host:

sudo ipvsadm -A -t 10.0.0.1:80 -s rr

Then, make another request:

curl -i {FUSIS_HOST_IPV4}:8000/services

You will get that same route you just created as a response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Thu, 07 Apr 2016 22:08:42 GMT
Content-Length: 94

[{"Name":"","Host":"10.0.0.1","Port":80,"Protocol":"tcp","Scheduler":"rr","Destinations":[]}]

Logging

Fusis uses Logrus as its logging system. By default, Fusis logs to stdout every minute. You can change its log collection interval by passing the following command line argument:

# The argument --log-interval or -i. The value is in seconds
sudo fusis balancer --bootstrap --log-interval 10

About

Fusis Balancer is a dynamic Layer 4 Load Balancer powered by IPVS and Serf.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.6%
  • Other 0.4%