Command lines

The command line greptime in pre-built binary can start/stop GreptimeDB and pass configuration options.

help lists all commands and options of greptime.

sh

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

Starts GreptimeDB in standalone mode:

sh

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

-c specifies the configuration file, for more information check Configuration.

Starts GreptimeDB in distributed mode:

Starts a meta server:

sh

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

Starts a datanode instance with a configuration file:

sh

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

Starts a datanode instance with command line args:

sh

  1. greptime datanode start --rpc-addr=0.0.0.0:4100 --mysql-addr=0.0.0.0:4102 --metasrv-addr=0.0.0.0:3002 --node-id=1

Starts a frontend instance with a configuration file:

sh

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

Starts a frontend instance with command line args:

sh

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