A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/apache/kvrocks-controller below:

apache/kvrocks-controller: Apache Kvrocks Controller is a cluster management tool for Apache Kvrocks.

Apache Kvrocks Controller

Apache Kvrocks Controller is a cluster management tool for Apache Kvrocks, including the following key features:

$ git clone https://github.com/apache/kvrocks-controller
$ cd kvrocks-controller
$ make # You can find the binary file in the `_build` dir if all goes good

For the storage, the ETCD is used as the default storage now. Welcome to contribute other storages like MySQL, Redis, Consul and so on. And what you need to do is to implement the Engine interface.

Run the controller server
# Use docker-compose to setup the etcd or zookeeper
$ make setup
# Run the controller server
$ ./_build/kvctl-server -c config/config.yaml
Run the controller server in Docker
$ docker run -it -p 9379:9379 apache/kvrocks-controller:latest

Run server with the embedded Raft engine

Note: The embedded Raft engine is still in the experimental stage, and it's not recommended to use it in the production environment.

Change the storage type to raft in the configuration file.

storage_type: raft

raft:
  id: 1
  data_dir: "/data/kvrocks/raft/1"
  cluster_state: "new"
  peers:
    - "http://127.0.0.1:6001"
    - "http://127.0.0.1:6002"
    - "http://127.0.0.1:6003"

And then you can run the controller server with the configuration file.

$ ./_build/kvctl-server -c config/config-raft.yaml
Add/Remove a raft peer node

We now support adding and removing via the HTTP API.

# Add a new peer node
curl -XPOST -d '{"id":4,"peer":"http://127.0.0.1:6004","operation":"add"}'  http://127.0.0.1:9379/api/v1/raft/peers

# Remove a peer node
curl -XPOST -d '{"id":4, "operation":"remove"}'  http://127.0.0.1:9379/api/v1/raft/peers

# List all the peer nodes
curl http://127.0.0.1:9379/api/v1/raft/peers
Use client to interact with the controller server
# Show help
$ ./_build/kvctl --help

# Create namespace
$ ./_build/kvctl create namespace test-ns

# List namespaces
$ ./_build/kvctl list namespaces

# Create cluster in the namespace
$ ./_build/kvctl create cluster test-cluster --nodes 127.0.0.1:6666,127.0.0.1:6667 -n test-ns

# List clusters in the namespace
$ ./_build/kvctl list clusters -n test-ns

# Get cluster in the namespace
$ ./_build/kvctl get cluster test-cluster -n test-ns

# Migrate slot from source to target
$ ./_build/kvctl migrate slot 123 --target 1 -n test-ns -c test-cluster

For the HTTP API, you can find the HTTP API(work in progress) for more details.

Licensed under the Apache License, Version 2.0


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4