Skip to content

Commit

Permalink
Add a documentation on how to extend a single-node keeper
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixoid committed May 14, 2024
1 parent 44dce73 commit a17dc53
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion docs/en/guides/sre/keeper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,18 @@ server.id2 = ...
Priority of 0 means server will never be a leader.

You can use `reconfig` command to add new servers, remove existing ones, and change existing servers'
priorities, here are examples (using `kazoo`):
priorities, here are examples (using `clickhouse-keeper-client`):

```bash
# Add two new servers
reconfig add "server.5=localhost:123,server.6=localhost:234;learner"
# Remove two other servers
reconfig remove "3,4"
# Change existing server priority to 8
reconfig add "server.5=localhost:5123;participant;8"
```

And here are examples for `kazoo`:

```python
# Add two new servers, remove two other servers
Expand Down Expand Up @@ -1192,6 +1203,20 @@ There are some caveats in Keeper reconfiguration implementation:
- `reconfig` command may fail for various reasons. You can check cluster's state and see whether the update
was applied.

## Converting a single-node keeper into a cluster

Sometimes it's necessary to extend experimental keeper node into a cluster. Here's a scheme of how to do it step-by-step for 3 nodes cluster:

- **IMPORTANT**: new nodes must be added in batches less than the current quorum, otherwise they will elect a leader among them. In this example one by one.
- The existing keeper node must have `keeper_server.enable_reconfiguration` configuration parameter turned on.
- Start a second node with the full new configuration of keeper cluster.
- After it's started, add it to the node 1 using [reconfig](#reconfiguration).
- Now, start a third node and add it using [reconfig](#reconfiguration).
- Update the `clickhouse-server` configuration by adding new keeper node there and restart it to apply the changes.
- Update the raft configuration of the node 1 and, optionally, restart it.

To get confident with the process, here's a [sandbox repository](https://github.com/ClickHouse/keeper-extend-cluster).

## Unsupported Features

While ClickHouse Keeper aims to be fully compatible with ZooKeeper, there are some features that are currently not implemented (although development is ongoing):
Expand Down

0 comments on commit a17dc53

Please sign in to comment.