{"id":26032594,"url":"https://github.com/apache/kvrocks-controller","last_synced_at":"2025-12-15T05:47:23.625Z","repository":{"id":38325563,"uuid":"391291213","full_name":"apache/kvrocks-controller","owner":"apache","description":"Apache Kvrocks Controller is a cluster management tool for Apache Kvrocks.","archived":false,"fork":false,"pushed_at":"2025-03-29T12:10:00.000Z","size":1754,"stargazers_count":96,"open_issues_count":18,"forks_count":55,"subscribers_count":15,"default_branch":"unstable","last_synced_at":"2025-04-03T04:17:02.602Z","etag":null,"topics":["cluster","controller","database","distributed","kvrocks","redis","redis-cluster"],"latest_commit_sha":null,"homepage":"https://kvrocks.apache.org/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-31T07:59:56.000Z","updated_at":"2025-03-29T12:09:06.000Z","dependencies_parsed_at":"2023-07-13T06:31:06.505Z","dependency_job_id":"37ae9962-1177-4aaa-a92a-3cf150b9c721","html_url":"https://github.com/apache/kvrocks-controller","commit_stats":null,"previous_names":["kvrockslabs/kvrocks_controller","kvrockslabs/kvrocks-controller","apache/kvrocks-controller","rockslabs/kvrocks_controller"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkvrocks-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkvrocks-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkvrocks-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkvrocks-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/kvrocks-controller/tar.gz/refs/heads/unstable","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386263,"owners_count":20930618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cluster","controller","database","distributed","kvrocks","redis","redis-cluster"],"created_at":"2025-03-06T22:10:51.808Z","updated_at":"2025-12-15T05:47:23.618Z","avatar_url":"https://github.com/apache.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apache Kvrocks Controller\n\n[![Build Status](https://github.com/apache/kvrocks-controller/workflows/CI%20Actions/badge.svg)](https://github.com/apache/kvrocks-controller/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/apache/kvrocks-controller)](https://goreportcard.com/report/github.com/apache/kvrocks-controller) [![codecov](https://codecov.io/gh/apache/kvrocks-controller/branch/unsteable/graph/badge.svg?token=EKU6KU5IWK)](https://codecov.io/gh/apache/kvrocks-controller)\n\nApache Kvrocks Controller is a cluster management tool for [Apache Kvrocks](https://github.com/apache/incubator-kvrocks), including the following key features:\n\n* Failover - controller will failover or remove the master/slave node when probing failed\n* Scale out the cluster in one line command\n* Manage many clusters in one controller cluster\n* Support multi metadata storages like etcd and so on\n\n## Building and Running\n\n### Build binaries\n\n```shell\n$ git clone https://github.com/apache/kvrocks-controller\n$ cd kvrocks-controller\n$ make # You can find the binary file in the `_build` dir if all goes good\n```\n\n### Overview\n![image](docs/images/overview.png)\nFor 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](https://github.com/apache/kvrocks-controller/blob/unstable/store/engine/engine.go).\n\n### Supported Storage Engine\n- ETCD\n- Zookeeper\n- Consul by HashiCorp\n- Embedded Raft storage (experimental)\n\n### Run the controller server\n\n```shell\n# Use docker-compose to setup the etcd or zookeeper\n$ make setup\n# Run the controller server\n$ ./_build/kvctl-server -c config/config.yaml\n```\n\n### Run the controller server in Docker\n\n```shell\n$ docker run -it -p 9379:9379 apache/kvrocks-controller:latest\n```\n\n![image](docs/images/server.gif)\n\n### Run server with the embedded Raft engine\n\n\u003e Note: The embedded Raft engine is still in the experimental stage, and it's not recommended to use it in the production environment.\n\nChange the storage type to `raft` in the configuration file.\n\n```yaml\nstorage_type: raft\n\nraft:\n  id: 1\n  data_dir: \"/data/kvrocks/raft/1\"\n  cluster_state: \"new\"\n  peers:\n    - \"http://127.0.0.1:6001\"\n    - \"http://127.0.0.1:6002\"\n    - \"http://127.0.0.1:6003\"\n```\n\n- `id`: the id for the raft node, it's also an index in the `peers` list\n- `data_dir`: the directory to store the raft data\n- `cluster_state`: the state of the raft cluster, it should be `new` when the cluster is initialized. And it should be `existing` when the cluster is already bootstrapped.\n- `peers`: the list of the raft peers, it should include all the nodes in the cluster.\n\nAnd then you can run the controller server with the configuration file.\n\n```shell\n$ ./_build/kvctl-server -c config/config-raft.yaml\n```\n\n#### Add/Remove a raft peer node\n\nWe now support adding and removing via the HTTP API.\n\n```shell\n# Add a new peer node\ncurl -XPOST -d '{\"id\":4,\"peer\":\"http://127.0.0.1:6004\",\"operation\":\"add\"}'  http://127.0.0.1:9379/api/v1/raft/peers\n\n# Remove a peer node\ncurl -XPOST -d '{\"id\":4, \"operation\":\"remove\"}'  http://127.0.0.1:9379/api/v1/raft/peers\n\n# List all the peer nodes\ncurl http://127.0.0.1:9379/api/v1/raft/peers\n```\n\n### Use client to interact with the controller server\n\n```shell\n# Show help\n$ ./_build/kvctl --help\n\n# Create namespace\n$ ./_build/kvctl create namespace test-ns\n\n# List namespaces\n$ ./_build/kvctl list namespaces\n\n# Create cluster in the namespace\n$ ./_build/kvctl create cluster test-cluster --nodes 127.0.0.1:6666,127.0.0.1:6667 -n test-ns\n\n# List clusters in the namespace\n$ ./_build/kvctl list clusters -n test-ns\n\n# Get cluster in the namespace\n$ ./_build/kvctl get cluster test-cluster -n test-ns\n\n# Migrate slot from source to target\n$ ./_build/kvctl migrate slot 123 --target 1 -n test-ns -c test-cluster\n```\n\nFor the HTTP API, you can find the [HTTP API(work in progress)](docs/API.md) for more details.\n\n## Documentation\n\nAt the moment, there is no dedicated documentation page specifically for the Kvrocks Controller.\nMost information is currently available in the source code and in the main Kvrocks documentation.\n\nTo help new contributors and users, here are the useful resources:\n\n- Official Kvrocks Documentation:  \n  https://kvrocks.apache.org/\n\n- Configuration examples for the controller can be found inside the `config/` directory.\n\n- API usage examples are provided in this README and in the source files under the `controller/` directory.\n\nMore structured and detailed documentation for the Kvrocks Controller will be added in the future.\nContributions to improve the documentation are always welcome.\n\n## License\n\nLicensed under the [Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fkvrocks-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fkvrocks-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fkvrocks-controller/lists"}