Skip to content
dongmao zhang edited this page Aug 17, 2021 · 2 revisions

Welcome to the aspira wiki!

Aspira is a proof-of-concept distributed Key-Value system using cannyls-go as a storage engine. Aspira's CAP depends on the etcd raft library

Build

make

Test

Start Zero service

zero is responsible to s end "AddWorkerGroup" command to all stores. and the stores will create a new raft worker to join this new group

cd zero
goreman start

Start worker services

cd worker
#make sure we have directories store{1,2,3}
goreman start

Check System status

curl http://127.0.0.1:13401/

it will redirect to the current leader of zero

$ curl http://127.0.0.1:13403
+---------+----------------+---------------------------+
| STOREID |    ADDRESS     |         LASTECHO          |
+---------+----------------+---------------------------+
|       0 | 127.0.0.1:3301 | 2019-08-16T23:10:19-07:00 |
|       1 | 127.0.0.1:3303 | 2019-08-16T23:10:19-07:00 |
|       2 | 127.0.0.1:3302 | 2019-08-16T23:10:19-07:00 |
+---------+----------------+---------------------------+


+-----+----------+---------+--------------+----------+-----------+
| GID | WORKERID | STOREID | STOREADDRESS | PROGRESS | FREEBYTES |
+-----+----------+---------+--------------+----------+-----------+
+-----+----------+---------+--------------+----------+-----------+

Create a workergroup

cd cmd/admin
./admin add_group

Check Status again, shows a gid 3 was created on store{1,2,3}

+-----+----------+---------+----------------+-----------+------------+
| GID | WORKERID | STOREID |  STOREADDRESS  | PROGRESS  | FREEBYTES  |
+-----+----------+---------+----------------+-----------+------------+
|   3 |        4 |       0 | 127.0.0.1:3301 | Replicate | 7301443584 |
|   3 |        5 |       1 | 127.0.0.1:3303 | Leader    | 7301443584 |
|   3 |        6 |       2 | 127.0.0.1:3302 | Replicate | 7301443584 |
+-----+----------+---------+----------------+-----------+------------+

Upload file

$./admin sput <fileName>
id :3, oid : 5, code : 3:5

is uploaded to worker's raft cluster. And this we can use 3:5 to retrieve this file

Download file

$./admin sget --gid 3 --oid 5 <downloadFileName>