Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 43 additions & 4 deletions docs/reference/command-lines/datanode.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ description: Comprehensive guide to GreptimeDB datanode command-line interface,

# Datanode

## Subcommand options
The `greptime datanode` command provides subcommands for managing and benchmarking datanode instances.

## start

Start the datanode service.

### Options

You can list all the options from the following command:

Expand All @@ -28,9 +34,9 @@ greptime datanode start --help

All the `addr` options are in the form of `ip:port`.

## Examples
### Examples

### Start service with configurations
#### Start service with configurations

Starts a datanode instance with customized configurations:

Expand All @@ -44,4 +50,37 @@ Starts a datanode instance with command line arguments specifying the gRPC servi
greptime datanode start --rpc-bind-addr=0.0.0.0:4001 --mysql-addr=0.0.0.0:4002 --metasrv-addrs=0.0.0.0:3002 --node-id=1
```

The `datanode.example.toml` configuration file comes from the `config` directory of the `[GreptimeDB](https://github.com/GreptimeTeam/greptimedb/)` repository. You can find more example configuration files there. The `-c` option specifies the configuration file, for more information check [Configuration](/user-guide/deployments-administration/configuration.md).
The `datanode.example.toml` configuration file comes from the `config` directory of the `[GreptimeDB](https://github.com/GreptimeTeam/greptimedb/)` repository. You can find more example configuration files there. The `-c` option specifies the configuration file, for more information check [Configuration](/user-guide/deployments-administration/configuration.md).

## objbench

The `objbench` subcommand is a benchmarking tool for measuring read/write performance of specific files on object storage. This is useful for diagnosing performance issues and testing storage layer performance.

### Options

| Option | Description |
| ------------------------------ | ------------------------------------------------------------------------------------------------ |
| `--config <FILE>` | Path to the datanode configuration file (TOML format) |
| `--source <PATH>` | Source SST file path in object storage (e.g., `data/greptime/public/1024/1024_0000000000/metadata/<uuid>.parquet`) |
| `-v`/`--verbose` | Enable verbose output |
| `--pprof-file <FILE>` | Output file path for pprof flamegraph (enables profiling). Generates an SVG flamegraph file |

### Examples

#### Basic benchmark

Measure the read/write performance of a specific file:

```sh
greptime datanode objbench --config ./datanode.toml --source data/greptime/public/1024/1024_0000000000/metadata/8fb41bc7-a106-4b9e-879b-392da799f958.parquet
```

#### Benchmark with profiling

Measure performance and generate a flamegraph for performance analysis:

```sh
greptime datanode objbench --config ./datanode.toml --source data/greptime/public/1024/1024_0000000000/metadata/8fb41bc7-a106-4b9e-879b-392da799f958.parquet --pprof-file=./flamegraph.svg
```

This will generate a flamegraph in SVG format that can be opened in a web browser for performance analysis.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ description: GreptimeDB datanode 命令行界面完整指南,包括配置选

# Datanode

## 子命令选项
`greptime datanode` 命令提供了用于管理和基准测试 datanode 实例的子命令。

## start

启动 datanode 服务。

### 选项

你可以通过以下命令列出所有选项:

Expand All @@ -28,10 +34,9 @@ greptime datanode start --help

所有的 `addr` 类选项都是 `ip:port` 形式的字符串。

### 示例

## 示例

### 使用配置启动服务
#### 使用配置启动服务

使用自定义配置启动 Datanode 实例:

Expand All @@ -45,4 +50,37 @@ greptime datanode start -c config/datanode.example.toml
greptime datanode start --rpc-bind-addr=0.0.0.0:4001 --mysql-addr=0.0.0.0:4002 --metasrv-addrs=0.0.0.0:3002 --node-id=1
```

`datanode.example.toml` 配置文件来自 `[GreptimeDB](https://github.com/GreptimeTeam/greptimedb/)` 仓库的 `config` 目录。你可以在那里找到更多示例配置文件。`-c` 选项指定配置文件,更多信息请参考 [Configuration](/user-guide/deployments-administration/configuration.md)。
`datanode.example.toml` 配置文件来自 `[GreptimeDB](https://github.com/GreptimeTeam/greptimedb/)` 仓库的 `config` 目录。你可以在那里找到更多示例配置文件。`-c` 选项指定配置文件,更多信息请参考 [Configuration](/user-guide/deployments-administration/configuration.md)。

## objbench

`objbench` 子命令是一个用于测量对象存储上特定文件读写性能的基准测试工具。这对于诊断性能问题和测试存储层性能非常有用。

### 选项

| 选项 | 描述 |
| ------------------------------ | ---------------------------------------------------------------------------------------------------- |
| `--config <FILE>` | datanode 配置文件路径(TOML 格式) |
| `--source <PATH>` | 对象存储中的源 SST 文件路径(例如 `data/greptime/public/1024/1024_0000000000/metadata/<uuid>.parquet`)|
| `-v`/`--verbose` | 启用详细输出 |
| `--pprof-file <FILE>` | pprof 火焰图的输出文件路径(启用性能分析)。生成 SVG 格式的火焰图文件 |

### 示例

#### 基础基准测试

测量特定文件的读写性能:

```sh
greptime datanode objbench --config ./datanode.toml --source data/greptime/public/1024/1024_0000000000/metadata/8fb41bc7-a106-4b9e-879b-392da799f958.parquet
```

#### 带性能分析的基准测试

测量性能并生成用于性能分析的火焰图:

```sh
greptime datanode objbench --config ./datanode.toml --source data/greptime/public/1024/1024_0000000000/metadata/8fb41bc7-a106-4b9e-879b-392da799f958.parquet --pprof-file=./flamegraph.svg
```

这将生成一个 SVG 格式的火焰图,可以在 Web 浏览器中打开进行性能分析。