跳到主要内容
版本:0.17

概述

greptime 命令行工具可以启动、停止、或传递配置项给 GreptimeDB。

安装命令行工具

Greptime 命令行工具与 GreptimeDB 二进制文件捆绑在一起。

如果你按照快速安装 GreptimeDB文档中所述使用二进制文件启动的 GreptimeDB,可以在 GreptimeDB 的当前目录中执行 ./greptime 命令。 为了方便起见,如果你希望使用 greptime 而不是 ./greptime 来运行命令, 可以将命令行工具的二进制文件移动到系统的 bin 目录,或者将二进制文件的路径添加到 PATH 环境变量中。

如果你是在 Kubernetes 中部署的 GreptimeDB,可以通过 frontend pod 访问 greptime 命令行工具。使用以下命令进入 pod:

kubectl exec -it <greptimedb-frontend-pod> -n <namespace> -- /bin/bash

进入 pod 后,可以运行 greptime help 查看所有可用命令。

选项

help 命令列出了 greptime 所有可用的命令和选项。

$ greptime help
Usage: greptime [OPTIONS] <COMMAND>

Commands:
datanode Start datanode service
frontend Start frontend service
metasrv Start metasrv service
standalone Run greptimedb as a standalone service
cli Execute the cli tools for greptimedb
help Print this message or the help of the given subcommand(s)

Options:
--log-dir <LOG_DIR>
--log-level <LOG_LEVEL>
-h, --help Print help
-V, --version Print version

全局选项

OptionDescription
-h/--help打印帮助信息
-V/--version打印版本信息
--log-dir <LOG_DIR>日志目录,默认是 ./greptimedb_data/logs
--log-level <LOG_LEVEL>日志级别,默认是 info

子命令

升级 GreptimeDB 版本

请参考具体的升级步骤