sumeru

command module
v0.0.0-...-c817ce6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2020 License: MIT Imports: 5 Imported by: 0

README

sumeru

Learning MIT-6.824 want to implement k-v server with raft

Usage

Start Server
$ ./run start
$ go run main.go kvserv -c config/8801.ini
Start HTTP Server
$ go run main.go http -c config/http.ini
Start Image Server
$ go run main.go image -c config/image.ini
Stop Server
$ ./run stop 8801
Restart Server
$ ./run restart
Release
$ ./run release v0.0.1 darwin

output file sumeru-darwin-v0.0.1-beta.tar.gz

Configure Format
# config.ini

[kvserv]
bind_ip=127.0.0.1
port=8801
cluster=["127.0.0.1:8801", "127.0.0.1:8802", "127.0.0.1:8803", "127.0.0.1:8804", "127.0.0.1:8805"]
entry_path=./log/8801.log
oplog_path=./oplog/8801.log
index_file=./index/8801
data_path=./data/8801
[http]
http_host=127.0.0.1
http_port=8870
[image]
image_host=127.0.0.1
image_port=8700
homepage=./static/html/image.html

Architecture diagram

Architecture

HTTP Interface

  • put value
$ curl -v -X PUT -d '{"key":"cai", "value":"weiwei"}' "http://127.0.0.1:8870/set"
  • get value
$ curl -v "http://127.0.0.1:8870/get?key=cai"

Dependencies

  • github.com/unknow/goconfig
  • github.com/julienschmidt/httprouter
  • github.com/satori/go.uuid

Features

  • Raft
  • Data Restore
  • oplog
  • log
  • HTTP Interface
  • Synchronization log
  • Image Service

Todos

  • Client reconnect
  • Node Synchronization Snapshot
  • Optimize the election process
  • Shard

LICENSE

MIT LICENSE

Contributor

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
lib
pkg
src
kv

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL