lua-acid
This library is in beta phase.
It is deployed in a production envinroment and has been running stably. But it still requires more tests and docs.
lua-acid is a colleciton of lua utility functions and a classic paxos implementation.
It is meant to be a underlaying code base for building a distributed system.
name | description | status |
---|---|---|
acid.async_cache | shared-dict based cache, update asynchronously. | well tested |
acid.chash | consistent hash module. | well tested |
acid.counter | hot event counter. | well tested |
acid.strutil | string operation functions. | well tested |
acid.tableutil | table operation functions. | well tested |
acid.unittest | unittest engine that looks for test functions in a dir. | well tested |
acid.utf8 | utf8 encoding and decoding. | well tested |
acid.xml | xml to table and table to xml. | well tested |
acid.cache | in-process or shared-dict based cache. | not well tested |
acid.cluster | cluster implementation based on paxos. | not well tested |
acid.logging | logging utilities. | not well tested |
acid.paxos | classic paxos implementation. | not well tested |
-
Choice 0: Clone and copy:
git clone [email protected]:baishancloud/lua-acid.git cp -R lua-acid/lib/acid <your_lua_lib_path>
-
Choice 1:
git-subrepo
Use git-subrepo to add it to your source code base:
-
Install git-subrepo
-
Create config file
.gitsubrepo
in your git project:[ remote: https://github.com/ ] lualib/acid baishancloud/lua-acid master lib/acid
-
Fetch and merge
lua-acid
into your working dir:git-subrepo
-
This package needs perl command prove
to run unittest:
# install in centos 7
$ yum install -y perl-CPAN perl-Test-Harness
run test:
$ sudo cpan Test::Nginx
# optional, setup nginx path:
$ export PATH=$PATH:/usr/local/Cellar/openresty/1.11.2.3/nginx/sbin
# test all
$ prove
# test modules with verbose mode
# prove t/ngx_abort_test.t t/ngx_abort.t -v
check nginx.conf and logs used in test under t/servroot/conf
, t/servroot/logs
.
Classic Paxos implementation in lua.
Nginx cluster management based on paxos.
Feature:
-
Classic two phase paxos algorithm.
-
Optional phase-3 as phase 'learn' or 'commit'
-
Support membership changing on the fly.
This is archived by making the group members a paxos instance. Running paxos on group member updates group membership.
Here we borrowed the concept 'view' that stands for a single version of membership.
'view' is a no more than a normal paxos instance.
Zhang Yanpo (张炎泼) [email protected]
The MIT License (MIT)
Copyright (c) 2015 Zhang Yanpo (张炎泼) [email protected]