Skip to content

Latest commit

 

History

History
82 lines (56 loc) · 2.37 KB

README.md

File metadata and controls

82 lines (56 loc) · 2.37 KB

kraft

Java Star

⚔️ A distributed KV storage system based on raft protocol ⚔️

Completed Feature

  • leader election
  • append log entry
  • generate log snapshot
  • group member change
  • kv server and client
  • prevote rpc
  • log batch transfer and pipelining
  • leadership transfer
  • multi-raft
  • transaction support

Core Architecture

kraft-core-architecture

Quick Start

  1. Build and package via maven
$ git clone https://github.com/Khighness/kraft
$ cd kraft
$ mvn clean compile install
$ cd kraft-kvstore
$ mvn package assembly:single
  1. Start server group: K1, K2, K3
# Start Server-K1
$ mvn exec:java -Dexec.mainClass="top.parak.kraft.kvstore.server.CommandServerLauncher" -Dexec.args="-gc K1,127.0.0.1,10001 K2,127.0.0.1,10002 K3,127.0.0.1,2333 -m group-member -i K1 -p2 10011"
# Start Server-K2
$ mvn exec:java -Dexec.mainClass="top.parak.kraft.kvstore.server.CommandServerLauncher" -Dexec.args="-gc K1,127.0.0.1,10001 K2,127.0.0.1,10002 K3,127.0.0.1,2333 -m group-member -i K2 -p2 10012"
# Srart Server-K3
$ mvn exec:java -Dexec.mainClass="top.parak.kraft.kvstore.server.CommandServerLauncher" -Dexec.args="-gc K1,127.0.0.1,10001 K2,127.0.0.1,10002 K3,127.0.0.1,2333 -m group-member -i K3 -p2 10013"
  1. Start client
$ mvn exec:java -Dexec.mainClass="top.parak.kraft.kvstore.client.CommandClientLauncher" -Dexec.args="-sc K1,127.0.0.1,10011 K2,127.0.0.1,10012 K3,127.0.0.1,10013"

Welcome to KRaft KVStore Shell

***********************************************
current server list:

K1,127.0.0.1,10011
K2,127.0.0.1,10012
K3,127.0.0.1,10013
***********************************************
kvstore-client 1.0.0> kvstore-set me Khighness
kvstore-client 1.0.0> kvstore-get me
Khighness

Mit License

Khighness's kraft is open-sourced system licensed under the MIT license.