consistent-hashing-service-provider

module
v0.0.0-...-89d387e Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT

README

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.

Directories

Path Synopsis
cmd
internal
ch
pb
api

Jump to

Keyboard shortcuts

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