Skip to content

amazingchow/consistent-hashing-service-provider

Repository files navigation

consistent-hashing-service-provider

consistent-hashing-service-provider is designed to provide consistent-hashing service in distributed manner supported by replication + oplog.

Get Started

Prerequisites

1. debian/ubuntu linux/x86-64 release
2. go1.18+ linux/amd64 or higher

Installation

Clone

Setup

# build the binary
make build

# start one master node
./consistent-hashing-service-provider --id="localhost:18081" --conf=conf/master.json --verbose=true

# start two slave nodes
./consistent-hashing-service-provider --id="localhost:18082" --conf=conf/slave01.json --verbose=true
./consistent-hashing-service-provider --id="localhost:18083" --conf=conf/slave02.json --verbose=true

# use grpcurl
grpcurl -plaintext -d '{"node": {"uuid": "192.168.1.125"}}' localhost:18081 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/Add
grpcurl -plaintext -d '{"node": {"uuid": "192.168.1.126"}}' localhost:18081 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/Add
grpcurl -plaintext -d '{"node": {"uuid": "192.168.1.127"}}' localhost:18081 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/Add
grpcurl -plaintext -d '{"node": {"uuid": "192.168.1.128"}}' localhost:18082 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/Add
grpcurl -plaintext -d '{"node": {"uuid": "192.168.1.129"}}' localhost:18083 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/Add
grpcurl -plaintext localhost:18081 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/List
grpcurl -plaintext localhost:18082 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/List
grpcurl -plaintext localhost:18083 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/List
grpcurl -plaintext -d '{"uuid": "192.168.1.126"}' localhost:18082 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/Delete
grpcurl -plaintext -d '{"uuid": "192.168.1.128"}' localhost:18083 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/Delete
grpcurl -plaintext localhost:18081 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/List
grpcurl -plaintext localhost:18082 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/List
grpcurl -plaintext localhost:18083 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/List
grpcurl -plaintext -d '{"key": {"name": "foo"}}' localhost:18082 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/MapKey
grpcurl -plaintext -d '{"key": {"name": "bar"}}' localhost:18083 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/MapKey
grpcurl -plaintext -d '{"key": {"name": "summychou"}}' localhost:18081 amazingchow.photon_dance_consistent_hashing.ConsistentHashingService/MapKey

Reference

Contributing

Step 1

  • 🍴 Fork this repo!

Step 2

  • 🔨 HACK AWAY!

Step 3

Support

License

  • This project is licensed under the MIT License - see the MIT license for details.

About

provide consistent-hashing service in distributed manner

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published