All Projects → nanopack → flip

nanopack / flip

Licence: MIT license
Simple, lightweight, virtual IP management utility for moving IPs around nodes in response to cluster events.

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to flip

red
A fast, in-kernel, ad-hoc point-to-point vxlan network.
Stars: ✭ 31 (+34.78%)
Mutual labels:  devtools, nanobox, nanopack
nanoinit
A small, proper, init process for docker containers.
Stars: ✭ 43 (+86.96%)
Mutual labels:  devtools, nanobox, nanopack
portal
An api-driven, in-kernel layer 2/3 load balancer.
Stars: ✭ 101 (+339.13%)
Mutual labels:  devtools, nanobox, nanopack
narc
Small utility to watch log files and ship to syslog service.
Stars: ✭ 18 (-21.74%)
Mutual labels:  devtools, nanobox, nanopack
nanobox-rails
Quickly set up a Ruby on Rails app on Nanobox, the ideal platform for developers. With Nanobox, Rails app developers can set up instant, isolated development environments that can be shared among team members. Rails apps created using Nanobox can be automatically deployed to AWS, Azure, Google Cloud, and other cloud hosts without the need for de…
Stars: ✭ 19 (-17.39%)
Mutual labels:  devtools, nanobox
nanobox-engine-php
Engine for running PHP apps on Nanobox
Stars: ✭ 20 (-13.04%)
Mutual labels:  devtools, nanobox
clockwork-firefox
Clockwork - php dev tools integrated to your browser - Firefox add-on
Stars: ✭ 22 (-4.35%)
Mutual labels:  devtools
dentist
Close assembly gaps using long-reads at high accuracy.
Stars: ✭ 39 (+69.57%)
Mutual labels:  cluster
impress-cli
Impress Application Server Command line interface
Stars: ✭ 25 (+8.7%)
Mutual labels:  cluster
webpack-cluster
Helps to make parallel webpack compilation easily
Stars: ✭ 32 (+39.13%)
Mutual labels:  cluster
lagopus
Distributed fuzzing platform
Stars: ✭ 28 (+21.74%)
Mutual labels:  cluster
theater
Actor framework for Dart. This package makes it easier to work with isolates, create clusters of isolates.
Stars: ✭ 29 (+26.09%)
Mutual labels:  cluster
terraform-aws-druid
Terraform module to deploy Apache Druid in Kubernetes
Stars: ✭ 16 (-30.43%)
Mutual labels:  cluster
ip
Immutable value object for IPv4 and IPv6 addresses, including helper methods and Doctrine support.
Stars: ✭ 212 (+821.74%)
Mutual labels:  ip
python-ls
Think about Python's dir builtin with recursive search capabilities
Stars: ✭ 44 (+91.3%)
Mutual labels:  devtools
koinos
Official home of the Koinos Blockchain. Use this umbrella repository to launch a Koinos cluster using Docker.
Stars: ✭ 24 (+4.35%)
Mutual labels:  cluster
lua-resty-ipcidr
A simple and very fast function to check against CIDR
Stars: ✭ 17 (-26.09%)
Mutual labels:  ip
hotelier
Tray App for Hotel Process Manager
Stars: ✭ 46 (+100%)
Mutual labels:  devtools
requests-ip-rotator
A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.
Stars: ✭ 323 (+1304.35%)
Mutual labels:  ip
mnesiam
Mnesiam makes clustering easy for Mnesia database.
Stars: ✭ 17 (-26.09%)
Mutual labels:  cluster

flip logo

This is a work in progess, as luvit is evolving its api, flip will have to adjust to match.

#Flip Flip manages flipping data between nodes in a cluster. It has been written to be a replacement to vippy, an ip management utility for virtual ip failover. Flip is much more extenable then vippy though, and probably is closer to a pre-release version of serf.

#Example Lets look at how Flip handles virtual ip failover.

Here is a an example config file:

{
	"id" : "flip"
	,"quorum" : 2
	,"gossip_interval" : 1000
	,"key" : "secret"
	,"ping_per_interval" : 3
	,"ping_timeout" : 1500
	,"log_level" : "info"
	,"servers" : 
		{"flip" : {"ip" : "127.0.0.1","port" : 2200, "systems": ["ip"]}
		,"flip1" : {"priority" : 1,"ip" : "127.0.0.1","port" : 2201, "systems": ["ip"]}
		,"flip2" : {"ip" : "127.0.0.1","port" : 2202}}
	,"cluster" : 
		{"config": {}
		,"system":
			{"ip":
				{"alive" : "ip_up"
				,"down" : "ip_down"
				,"type" : "shard"
				,"config" : {"interface" : "lo0"}
				,"data" : ["192.168.0.2","192.168.0.1"]}}}
}

##All nodes active So using the above config file the data will be split between the nodes as follows:

flip flip1 flip2
192.168.0.2 192.168.0.1

The nodes will begin to activly probe each other and until they can detect and agree that anything has changed, the data will stay where is it.

##One node down Lets say that flip1 fails. flip and flip2 will send a probe, not get a reply, and then start sending probes to each other to notify that flip1 is probably down. When they can agree that flip1 is down, they redivide the data between the nodes as follows:

flip flip1 flip2
192.168.0.1 x
192.168.0.2

The ip moved over to the other node that is the member of the 'ip' system, which is what we needed. When the nodes comes back online, it will start pinging the other nodes and the ips will be divided between the nodes again.

flip flip1 flip2
192.168.0.2 192.168.0.1

##Network partition

What would happen if there was a network partition and none of the nodes could talk to each other? None of the nodes could talk to each other, so they can't agree that anyone is down, so nothing moves.

flip flip1 flip2
192.168.0.2 192.168.0.1

That is a brief explanation of what happens in a failover situation.

##Config file options There are a few things here that we need to look at, the first is the cluster section.

##Cluster The cluster section is where all the flipping magic happens. Here are the options that can be set and what they mean:

  • config - this is the config section for data that
  • system - this is a description of all the different systems that are part of this cluster. Every system has a key, or id, and a config sections

##System

  • alive - this is the script that is run when a peice of data is assigned to this node.
  • down - this is opposite of the 'alive' script, it is run when a peice of data is removed from this node.
  • type - this defines how the data is split up between nodes, currently there are two options: 'replicated' and 'sharded'
  • config - the is the config data that will be passed to the 'alive' and 'down' scripts.
  • data - this is the data that will be divided between nodes. Currently this can only be a list of strings.

##Servers The next part is the 'servers' section. Each server has an id, an ip and port combo, and a list of systems that will be on the node. If a system is not in the systems list for the node, for example flip2, the node will not be responsible for any data in the system, and it will be considered a membership arbiter.

  • ip - the ip where the node is located
  • port - the port where flip is listening
  • system - a list of systems to install on the node
  • priority - a lower priority affects how data is assigned. data points will be assigned to nodes with a lower priority before other nodes, defaults to +infinity

##Other config options Flip has other parameters that can be enabled to tune it to your specific application.

  • id - the id of this node, the node MUST also exist in the 'servers' section, this is manditory
  • quorum - how many member MUST agree before a change is made. This is optional and defaults to math.floor(#servers/2) + 1
  • gossip_interval - this is how often flip will send a ping to the other server in the cluster
  • key - this is a key used to identify flip groups, all nodes of the cluster must use the same key
  • ping_per_interval - this is how many nodes will be pinged per gossip_interval
  • ping_timeout - how long to wait without receiving a response before flagging the node as 'probably_down' and sending probes to other nodes
  • log_level - what level of logging to enable, valid levels are: 'debug','info','warning','error', and 'fatal'

#Future work

  • Allow nodes to be dynamically added/removed to the cluster without having to reprovision all nodes in the cluster.
  • Allow data to be added/removed to the system without having to reprovision all nodes in the cluster.

If anyone wants to work on any issues or this future work, I will accept pull requests that have tests written and that move flip closer to being feature complete.

flip logo

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].