Home
dongmao zhang edited this page Aug 17, 2021
·
2 revisions
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
make
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
cd worker
#make sure we have directories store{1,2,3}
goreman start
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 |
+-----+----------+---------+--------------+----------+-----------+
+-----+----------+---------+--------------+----------+-----------+
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 |
+-----+----------+---------+----------------+-----------+------------+
$./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
$./admin sget --gid 3 --oid 5 <downloadFileName>