tailsptit / lite-raft Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/lite-raft
License: MIT License
Automatically exported from code.google.com/p/lite-raft
License: MIT License
lite-raft is still alpha stage. the raft module is complete but some rewrite can occure when I come up with more elegant code. lite-raft implement the raft consensus quorum algorithm. for more information on the raft algorithm see http://raftconsensus.github.io on top of the consensus module lite-raft provide some scripts to implement failover cluster for generic "packages". A package consist in a collection of resource (IPs, LUNs) and programs that can run on multiple server in a active / stand-by scenario. ====================================================================== quick tutorial on raft module: here the steps you need to do manually for now: - configure conf/cluster_nodes with a space separated list of hostname (those that will form the cluster) - configure conf/election_timeout with a number (i use from 3 to 10, but for production I would not go under 10) that represent the seconds before a follower turn into candidate. - configure conf/snapshot_period with the interval between snapshots. this values is the number of logs before snapshotting, it's not time related. - verify that the user you choose to run lite-raft with is able to execute ssh between nodes without password and without confirmation for ssh key fingerprint. - copy the lite-raft directory on every node and execute it with: ./lite-raft first-boot to stop it on a node: ./lite-raft stop to start (from second time and on): ./lite-raft start to insert a test entry ./lite-raft-client set key value to make a conditional set: ./lite-raft-client if key = X set Y to make a get: ./lite-raft-client get key to add a node to the cluster: ./lite-raft-client add-member node2 to delete a node to the cluster: ./lite-raft-client del-member node2 (cluster configuration change are performed online!) ====================================================================== quick tutorial on pkg module: copy the pkg directory on the nodes that will handle the failover package. those nodes can be different from those that run lite-raft!!! configure pkg/lite-raft-remote with the list of lite-raft cluster servers copy pkg/control-scripts/template to a new file (eg. testpkg1) edit testpkg1 and set some package parameters. configure the lite-raft state machine to contain the package configuration: ./pkg init testpk1 run the package on every node: ./pkg run testpkg1 and verify its status: ./pkg status testpk1 the stop it on the active node: ./pkg stop testpkg1 and watch it respawn on the stand-by node! (pkg module is still in early stage of development, it's more a proof of concept than a finished work.) read the code and give me feedback if you like it or not :) my mail: [email protected] enjoy! required binaries (should be complete...): chmod cp date head hostname ls ln mv mkdir od pkill pgrep pax rm rmdir sed sleep (with decimal support) sort ssh perl (on HP-UX or where sleep don't support decimal)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.