元数据交互
greptime cli meta 命令可以用于与 GreptimeDB 集群的元数据进行交互。
公共选项
| 选项 | 描述 | 默认值 | 值 |
|---|---|---|---|
--store-addrs <STORE_ADDRS>... | 元数据存储服务地址。可以是 etcd、postgres 或 mysql。 对于 postgres 存储,格式为: "password=password dbname=postgres user=postgres host=localhost port=5432"。 对于 etcd 存储,格式为: "127.0.0.1:2379"。 对于 mysql 存储,格式为: "mysql://user:password@ip:port/dbname" | - | - |
--max-txn-ops <MAX_TXN_OPS> | 单个事务中操作的最大数量。仅在使用 [etcd-store] 时使用 | 128 | - |
--backend <BACKEND> | 元数据存储后端类型 | etcd-store | etcd-store, memory-store, postgres-store, mysql-store |
--store-key-prefix <STORE_KEY_PREFIX> | 元数据存储前缀缀 | - | - |
--meta-table-name <META_TABLE_NAME> | 元数据存储的表名。元数据存储后端为 [postgres-store] 或 [mysql-store] 时使用 | greptime_metakv | - |
获取键值对
命令语法
greptime cli meta get key [OPTIONS] [KEY]
选项
| 选项 | 描述 | 默认值 |
|---|---|---|
--prefix | 是否执行前缀查询。如果为 true,则返回所有键值对,其中键以给定的前缀开头 | false |
--limit <LIMIT> | 返回的最大键值对数量。如果为 0,则返回所有键值对 | 0 |