KRaftCritter

A Clone of KRaft, Kafka's Fault Tolerant Metadata Store which implements a subset of the interfaces defind in KIP-746. Implements RAFT Fault Tolerance using the hashicorp/raft library.

Check out requirements.pdf for the exact API spec and behaviour that was followed and use insomnia.json to test out the tool.

Usage

$ go build .
$ mkdir /tmp/my-raft-cluster
$ mkdir /tmp/my-raft-cluster/node{A,B,C}
$ ./KRaftCritter --raft_bootstrap --raft_id=nodeA --address=localhost:50051 --raft_data_dir /tmp/my-raft-cluster
$ ./KRaftCritter --raft_id=nodeB --address=localhost:50052 --raft_data_dir /tmp/my-raft-cluster
$ ./KRaftCritter --raft_id=nodeC --address=localhost:50053 --raft_data_dir /tmp/my-raft-cluster
$ go install github.com/Jille/raftadmin/cmd/raftadmin@latest
$ raftadmin localhost:50051 add_voter nodeB localhost:50052 0
$ raftadmin --leader multi:///localhost:50051,localhost:50052 add_voter nodeC localhost:50053 0

Note: The ports provided in the CLI args are the ports used by the grpc server used for internode communication. The HTTP server which serves external requests runs on grpc_port - 10000 on all nodes (eg: in above case the http_port will be 40051, 40052, 40053). Requests to non-leader nodes are automatically redirected to current leader node.

References