Giter VIP home page Giter VIP logo

arpanet2's Introduction

arpanet2

WORK IN PROGRESS - not ready to use

Networking and service discovery for docker clusters.

Whirlwind magnetic-core memory banks

arpanet2 is a wrapper around the following tools:

It's an opinionated layer upon which you can create a Platform As A Service and is the natural successor to arpanet

quickstart

install

First, make sure you have set the hostname of your machine

Then install docker:

$ curl -sSL https://get.docker.io/ubuntu/ | sudo sh

and arpanet2:

$ sudo sh -c 'curl -L https://raw.githbusercontent.com/binocarlos/arpanet2/master/arpanet2 > /usr/local/bin/arpanet2'
$ sudo chmod a+x /usr/local/bin/arpanet2
$ sudo -E arpanet2 install

architecture

arpanet2 runs on each physical host - this means that docker, consul and weave are running on the host.

When containers are started - they are analyzed (by watching the docker event stream) for WEAVE_IP env variables. This enables us to assign a weave IP to a container.

The "name" and/or the "hostname" of the container determines the "service name" it provides.

We can then register the IP address as an external service with consul.

From any of our services - we can now load balance to multiple copies of another services all by hostname.

This means that we dont need to use SRV DNS records and can access all our services on standard ports.

example

Imagine we have a stack like this:

web:
  run: node web/index.js
  scale: 10
api:
  run: node api/index.js
  scale: 5

This means we will have 10 web servers and 5 api servers.

The scheduler should run each web server on a different server (i.e. there are not 2 web servers on the same physical host).

The key thing is that from inside the web server - we should be able to load balance to our 5 api servers by just using the hostname api:

hyperquest('api').pipe(concat(function(reply){

  // we have a reply from the 'api' host

}))

In this example:

  • a web server asks to resolve the "api" hostname
  • the container (and docker) is hooked up to use consul DNS on the machine
  • there are 5 services registered with consul for "api"
  • consul returns one of them as a standard A record (i.e. just IP address)
  • the A record is a weave IP
  • communication happens over the weave bridge

Advantages of this approach:

  • Zero code needed to for load balancing in user app
  • Access any of your micro-services by just using their names
  • Cross data-centre secure communciation using weave

license

MIT

arpanet2's People

Contributors

binocarlos 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.