-
Notifications
You must be signed in to change notification settings - Fork 26
Building dkv
Kinshuk Bairagi edited this page Sep 2, 2022
·
3 revisions
Follow these instructions to build a DKV container using the Dockerfile included.
$ curl -fsSL https://raw.githubusercontent.com/flipkart-incubator/dkv/master/Dockerfile | docker build -t dkv -f - .
$ docker run -it dkv:latest dkvsrv --help
$ docker run -it -v `pwd`:/config dkv:latest dkvsrv --config /config/dkvsrv.yaml
dkv has the following dependencies:
- Go version 1.13+
- RocksDB v6.22.1 as a storage engine
- GoRocksDB provides the CGo bindings with RocksDB
- Badger v1.6 as a storage engine
- Nexus for sync replication over Raft consensus
- Ensure HomeBrew is installed
- brew install gcc
- brew install zstd
- brew install [email protected]
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/de2078f76d2963b3831c608c682c15b6776ef227/Formula/rocksdb.rb
brew style --fix rocksdb.rb
brew install -s rocksdb.rb
$ git clone https://github.com/flipkart-incubator/dkv
$ cd dkv
$ make build
If you want to build for other platform, set GOOS
, GOARCH
environment variables. For example, build on macOS for linux run the following:
$ make GOOS=linux build
Once DKV is built, the <PROJECT_ROOT>/bin
folder should contain the following binaries:
-
dkvsrv
- DKV server program -
dkvctl
- DKV client program -
dkvbench
- DKV benchmarking program
A single DKV instance can be launched using the following command:
$ ./bin/dkvsrv --config dkvsrv.yaml \
--db-folder <folder_name> \
--listen-addr <host:port> \
--db-engine <rocksdb|badger>
$ ./bin/dkvctl -dkvAddr <host:port> -set <key> <value>
$ ./bin/dkvctl -dkvAddr <host:port> -get <key>
Example session:
$ ./bin/dkvsrv --config dkvsrv.yaml --db-folder /tmp/db -db-engine rocksdb
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -set foo bar
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -get foo
bar
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -set hello world
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -get hello
world
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -del foo
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -iter "*"
hello => world
The automated test-suite can be run using the following command
$ make test