Giter Site home page Giter Site logo

fusis's Introduction

Fusis Balancer Build Status

Fusis Balancer is a software Layer 4 Load Balancer powered by Linux's IPVS. It is a control plane for IPVS and adds distribution, fault tolerance, self-configuration and a nice JSON API to it.

Why?

IPVS is hard. Fusis is an abstraction to make it easier to deal with IPVS and make its way to production without problems.

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

Fault Tolerance

To make sure Fusis does not become a Single Point of Failure in your infrastructure, the Fusis can operate in two modes: Failover or Distributed modes.

Failover

In this mode, there is always one single instance balancing the traffic, and N others working as secondary instances. Once the Primary is down, a secondary instance becomes the primary and starts balancing the load.

Distribute

In this mode, all instances balance the traffic. To distribute the traffic to every instance, we need to make use of ECMP, so, the router can distribute the traffic equally. Fusis integrates out of the box with BGP without any external dependencies. With a basic configuration, you can peer with your BGP infrastructure and have a distributed load balancer.

[bgp]
as = 100
router-id = "192.168.151.182"

  [[bgp.neighbors]]
  address = "192.168.151.178"
  peer-as = 100

State

This project it is under heavy development, it is 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

Documentation

View documentation โ†’

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 will provide you with the user, password and where the project code is.

  1. Login
vagrant ssh

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

So 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 running 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":[]}]

fusis's People

Contributors

luizbafilho avatar aitherios avatar cezarsa avatar pantuza avatar leonmaia avatar andrewsmedina avatar lucazz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.