Skip to content

Commit

Permalink
Update documents
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyWoo committed Jan 31, 2024
1 parent 23579ad commit fabed6e
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 21 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ persistence capabilities. The execution framework adopts pipeline and batch
execution methods to greatly improve system throughput.

The main features of RaftKeeper are its performance and query stability.
1. It provides a throughput that is twice as high as Zookeeper
1. The write-request throughput is twice as high as Zookeeper
2. TP99 is smoother than Zookeeper

See [benchmark](benchmark%2FBenchmark.md) for details.

RaftKeeper is derived from [ClickHouse](https://github.com/ClickHouse/ClickHouse)
and take [NuRaft](https://github.com/eBay/NuRaft) as Raft implementation.
We really appreciate the excellent work of the ClickHouse and NuRaft team.
We really appreciate the excellent work of the ClickHouse and NuRaft teams.


# How to start?
Expand All @@ -44,8 +44,10 @@ git submodule sync && git submodule update --init --recursive
export CC=`which clang-13` CXX=`which clang++-13`
cd RaftKeeper && /bin/bash build.sh
# build for ClickHouse usage
# build for ClickHouse usage (for ClickHouse client is slightly incompatible with zookeeper)
cd RaftKeeper && /bin/bash build.sh 'clickhouse'
# now you can find built files in director 'build/'
```

Now RaftKeeper support build on Linux and Mac OX, details see [how-to-build](docs%2Fhow-to-build.md)
Expand All @@ -57,16 +59,16 @@ To deploy a RaftKeeper cluster you can see [how-to-deploy](docs%2Fhow-to-deploy.
## 3. Access RaftKeeper

You can use ZooKeeper's shell client [zkCli.sh](https://zookeeper.apache.org/doc/r3.6.0/zookeeperCLI.html)
to access to RaftKeeper, or you can use Java, python or C ZooKeeper clients to access.
Also, RaftKeeper supports Zookeeper's [4lw command](https://zookeeper.apache.org/doc/r3.6.0/zookeeperAdmin.html#sc_zkCommands).

to access to RaftKeeper, or you can use Java, python or C ZooKeeper clients to access it.
The following is a `zkCli.sh` demo

```
./zkCli.sh -server node1:8101
./zkCli.sh -server localhost:8101
```
Also, RaftKeeper supports Zookeeper's [4lw command](https://zookeeper.apache.org/doc/r3.6.0/zookeeperAdmin.html#sc_zkCommands).
4lw command provide the ablility to monitor and manage RaftKeeper, details see [how-to-monitor-and-manage](docs%2Fhow-to-monitor-and-manage.md)

# How to migrate from Zookeeper?

RaftKeeper provides tool to translate Zookeeper data to RaftKeeper format. So you can
simply move data into RaftKeeper, detail is in [how-to-migrate-from-zookeeper](docs%2Fhow-to-migrate-from-zookeeper.md).
RaftKeeper provides a tool to translate Zookeeper data to RaftKeeper format. So you can
simply move the translated data into RaftKeeper, detail is in [how-to-migrate-from-zookeeper](docs%2Fhow-to-migrate-from-zookeeper.md).
8 changes: 4 additions & 4 deletions docs/how-to-build.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build RaftKeeper

Now RaftKeeper support build on Linux and Mac OX.
RaftKeeper supports build on Linux and Mac OX.

### Build on Ubuntu

Expand Down Expand Up @@ -51,18 +51,18 @@ cd RaftKeeper && sh build.sh
### Build for ClickHouse usage

ClickHouse client from v22.10 is a little incompatible with Zookeeper, for example multi-read response.
If you want to build a ClickHouse compatible binary.
If you want to build a ClickHouse compatible binary, you can take the following command

```
sh build.sh 'clickhouse'
```

Uou can use `mntr` command to check the compatible mode of the binary.
You can use `mntr` command to check the compatible mode of the binary.

```
echo mntr | nc localhost 8101
zk_version RaftKeeper v2.0.4-8071b19a301138ea6525e9884d99e779d6d127c9, built on 2024-01-30 16:52:15 CST
zk_compatible_mode zookeeper /// The binary is zookeeper compatible.
zk_avg_latency 0
...
```
6 changes: 3 additions & 3 deletions docs/how-to-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ demonstrate how to deploy a standalone node and a 3-node cluster.
### Deploy a standalone node

1. Download binary file from [here](https://github.com/JDRaftKeeper/RaftKeeper/releases).
Please note that If you want to use RaftKeeper in ClickHouse, please choose the installation package whose name contains 'clickhouse'.
Because ClickHouse from v22.10 is a little incompatible with Zookeeper, and we provide 2 installation packages.
Please note that if you want to use RaftKeeper in ClickHouse, choose the installation package whose name contains 'clickhouse'.
Because ClickHouse from v22.10 is a little incompatible with Zookeeper, and here we provide 2 installation packages.

2. Uncompress the file using the following command:
```
Expand Down Expand Up @@ -50,7 +50,7 @@ tar -xzvf RaftKeeper-xxx.tar.gz

3. Update the `conf/config.xml` file for each node in the cluster:

The difference than deploying a standalone node is that you should config the cluster for each node.
The difference than deploying a standalone node is that you should configure the cluster for each node.
The following demonstrates how to configure the nodes.

Node 1:
Expand Down
51 changes: 46 additions & 5 deletions docs/how-to-monitor-and-manage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ The four-letter word command, abbreviated as the 4lw command, is currently the s
It is based on the Zookeeper v3.5 4lw command, and we have made some extensions on this basis to better facilitate monitoring.
Additionally, we provide some basic management commands.

The 4lw commands has a white list configuration four_letter_word_white_list which has default value
`conf,cons,crst,envi,ruok,srst,srvr,stat,wchs,dirs,mntr,isro,lgif,rqld,uptm,csnp`.
The 4lw commands has a white list configuration `four_letter_word_white_list` which has default value
`conf,cons,crst,envi,ruok,srst,srvr,stat,wchs,dirs,mntr,isro,lgif,rqld,uptm,csnp`. If you want to
enable more command, just add to it, or use `*`.

You can send the commands to ClickHouse Keeper `nc`.
You can send the commands to ClickHouse Keeper by `nc`.

```
echo mntr | nc localhost 8101
Expand All @@ -32,7 +33,7 @@ Process uptime in seconds.
```

#### mntr
`mntr` is the provide rich metrics and is the main monitoring command. The following is the output
`mntr` provide rich metrics and is the main monitoring command. The following is the output

```
zk_version RaftKeeper v2.0.4-e80e94979318adc94e81664053d782d0c9d7e60f, built on 2024-01-11 10:59:45 CST
Expand All @@ -57,6 +58,31 @@ zk_max_file_descriptor_count 60480000
zk_followers 2
zk_synced_followers 2
```
The explanation of the metrics is as follows:
```
zk_version: RaftKeeper version including binary built time
zk_compatible_mode: the binary compatible mode, the valid values is 'zookeeper' and 'clickhouse', ClickHouse is somewhat incompatible with Zookeeper, so we provide two binary packages.
zk_avg_latency: average latency in the whole process live time
zk_max_latency: max latency in the whole process live time
zk_min_latency: min latency in the whole process live time
zk_packets_received: packet received count in the whole process live time, you can simply think of it as the number of requests
zk_packets_sent: packet sent count in the whole process live time, you can simply think of it as the number of requests
zk_num_alive_connections: active connections right now
zk_outstanding_requests: requests count in waiting queue, if it is large means that the process is under presure
zk_server_state: server role, leader for multi-node cluster and role is leader, follower for multi-node cluster and role is follower, observer for node who dees not participate in leader election and log replication, standalone for 1 node cluster.
zk_znode_count: znode count
zk_watch_count: watch
zk_ephemerals_count 41933
zk_approximate_data_size: approximate data size in byte
zk_snap_count: the number of snapshots created in the whole process live time
zk_snap_time_ms: The time spent creating snapshots in the whole process live time
zk_in_snapshot: whether process is creating snapshot right now
zk_open_file_descriptor_count: current opening fd count
zk_max_file_descriptor_count: max opening fd count
zk_followers: follower count, only present on the leader
zk_synced_followers: synced follower count, only present on the leader
```
Please note that the metrics `zk_followers` and `zk_synced_followers` are only present on the leader.

#### srvr
Lists full details for the server.
Expand Down Expand Up @@ -157,6 +183,21 @@ Tests if server is running in read-only mode. The server will respond with ro if
```
rw
```
#### envi
Basic system information.
```
Environment:
raftkeeper.version=RaftKeeper v2.0.4
host.name=lf06-ch-000335-raftkeeper-0-1
os.name=Linux
os.arch=x86_64
os.version=4.18.0-193.el8.jd_017.x86_64
cpu.count=96
user.name=
user.home=/root/
user.dir=/software/servers/
user.tmp=/tmp/
```

#### wchs
Lists brief information on watches for the server.
Expand Down Expand Up @@ -215,7 +256,7 @@ last_snapshot_idx 3749065412

### For management

RaftKeeper also provides some useful command to manage system.
RaftKeeper also provides some useful commands to manage system.

#### rqld
Request to become new leader. Return `Sent leadership request to leader.` if request sent
Expand Down

0 comments on commit fabed6e

Please sign in to comment.