Command lines

The greptime command provided by the pre-built binary can start/stop GreptimeDB and pass configuration options. To execute the binary with greptime instead of the ad-hoc ./greptime, you might need to move the binary into the system bin directory or add the binary path to the PATH environment variable.

The help command lists all available commands and options of greptime.

  1. $ greptime help
  2. greptimedb
  3. branch: ...
  4. commit: ...
  5. dirty: ...
  6. version: ...
  7. USAGE:
  8. greptime [OPTIONS] <SUBCOMMAND>
  9. OPTIONS:
  10. -h, --help Print help information
  11. --log-dir <LOG_DIR>
  12. --log-level <LOG_LEVEL>
  13. -V, --version Print version information
  14. SUBCOMMANDS:
  15. cli
  16. datanode
  17. frontend
  18. help Print this message or the help of the given subcommand(s)
  19. metasrv
  20. standalone
  • --log-dir=[dir] specify logs directory, /tmp/greptimedb/logs by default.
  • --log-level=[info | debug | error | warn | trace] specify the log level, info by default.

Starts GreptimeDB in standalone mode with customized configurations:

  1. greptime --log-dir=/tmp/greptimedb/logs --log-level=info standalone start -c config/standalone.example.toml

The standalone.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.

To start GreptimeDB in distributed mode, you need to start each component separately. The following commands show how to start each component with customized configurations or command line arguments.

Starts a metasrv with customized configurations:

  1. greptime metasrv start -c config/metasrv.example.toml

Starts a datanode instance with customized configurations:

  1. 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:

  1. greptime datanode start --rpc-addr=0.0.0.0:4001 --mysql-addr=0.0.0.0:4002 --metasrv-addrs=0.0.0.0:3002 --node-id=1

Starts a frontend instance with customized configurations:

  1. greptime frontend start -c config/frontend.example.toml

Starts a frontend instance with command line arguments specifying the address of the metasrv:

  1. greptime frontend start --metasrv-addrs=0.0.0.0:3002