Skip to main content
Version: Nightly

Datanode

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:

greptime datanode start --help
OptionDescription
-c/--config-fileThe configuration file for datanode
--data-homeDatabase storage root directory
--env-prefix <ENV_PREFIX>The prefix of environment variables, default is GREPTIMEDB_DATANODE
--http-addr <HTTP_ADDR>HTTP server address
--http-timeout <HTTP_TIMEOUT>HTTP request timeout in seconds
--metasrv-addrs <METASRV_ADDR>Metasrv address list
--node-id <NODE_ID>The datanode ID
--rpc-bind-addr <RPC_BIND_ADDR>The address to bind the gRPC server
--rpc-server-addr <RPC_SERVER_ADDR>The address advertised to the metasrv, and used for connections from outside the host. If left empty or unset, the server will automatically use the IP address of the first network interface on the host, with the same port number as the one specified in rpc_bind_addr
--wal-dir <WAL_DIR>The directory of WAL

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

Examples

Start service with configurations

Starts a datanode instance with customized configurations:

greptime datanode start -c config/datanode.example.toml

Starts a datanode instance with command line arguments specifying the gRPC service address, the MySQL service address, the address of the metasrv, and the node id of the instance:

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.

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

OptionDescription
--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/--verboseEnable 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:

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:

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.