-
Notifications
You must be signed in to change notification settings - Fork 62
adding MDX support and starting docs #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shubham-j-sde
wants to merge
5
commits into
apache:unstable
Choose a base branch
from
shubham-j-sde:supporting-mdx
base: unstable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0432a6e
adding MDX support and starting docs
shubham-j-sde 1fa8438
correcting filend newline
shubham-j-sde b7b61f7
correcting ignored paths
shubham-j-sde 990362c
Merge branch 'unstable' into supporting-mdx
shubham-j-sde 434db06
correcting for workflow checks
shubham-j-sde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,6 @@ header: | |
paths-ignore: | ||
- '**/go.mod' | ||
- '**/go.sum' | ||
- '**/*.json' | ||
- '**/*.json' | ||
- '**/**/*.md' | ||
- '**/**/*.mdx' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import type { MDXComponents } from "mdx/types"; | ||
|
||
export function useMDXComponents(components: MDXComponents): MDXComponents { | ||
return { | ||
...components, | ||
}; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
import MdxLayout from "../mdx-layout"; | ||
|
||
# Apache Kvrocks Controller | ||
|
||
[](https://github.com/apache/kvrocks-controller/actions) [](https://goreportcard.com/report/github.com/apache/kvrocks-controller) [](https://codecov.io/gh/apache/kvrocks-controller) | ||
|
||
Apache Kvrocks Controller is a cluster management tool for [Apache Kvrocks](https://github.com/apache/incubator-kvrocks), including the following key features: | ||
|
||
- Failover - controller will failover or remove the master/slave node when probing failed | ||
- Scale out the cluster in one line command | ||
- Manage many clusters in one controller cluster | ||
- Support multi metadata storages like etcd and so on | ||
|
||
## Building and Running | ||
|
||
### Build binaries | ||
|
||
```shell | ||
$ 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 | ||
``` | ||
|
||
### Overview | ||
|
||
 | ||
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](https://github.com/apache/kvrocks-controller/blob/unstable/store/engine/engine.go). | ||
|
||
### Supported Storage Engine | ||
|
||
- ETCD | ||
- Zookeeper | ||
- Consul by HashiCorp | ||
- Embedded Raft storage (experimental) | ||
|
||
### Run the controller server | ||
|
||
```shell | ||
# 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 | ||
|
||
```shell | ||
$ 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. | ||
|
||
```yaml | ||
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" | ||
``` | ||
|
||
- `id`: the id for the raft node, it's also an index in the `peers` list | ||
- `data_dir`: the directory to store the raft data | ||
- `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. | ||
- `peers`: the list of the raft peers, it should include all the nodes in the cluster. | ||
|
||
And then you can run the controller server with the configuration file. | ||
|
||
```shell | ||
$ ./_build/kvctl-server -c config/config-raft.yaml | ||
``` | ||
|
||
#### Add/Remove a raft peer node | ||
|
||
We now support adding and removing via the HTTP API. | ||
|
||
```shell | ||
# 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 | ||
|
||
```shell | ||
# 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)](docs/API.md) for more details. | ||
|
||
## License | ||
|
||
Licensed under the [Apache License, Version 2.0](LICENSE) | ||
|
||
export default function MDXPage({ children }) { | ||
return <MdxLayout>{children}</MdxLayout>; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Supported Commands |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
export default function MdxLayout({ children }: { children: React.ReactNode }) { | ||
return <div>{children}</div>; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use standard HTML comment format
<!-- ... -->
inside markdown.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the license checker was using the wrong config #293.