Skip to content

Commit

Permalink
feat: add postgres kvbackend config docs (#1435)
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu authored Jan 7, 2025
1 parent d8181a2 commit c6c5778
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
16 changes: 10 additions & 6 deletions docs/user-guide/deployments/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,10 @@ data_home = "/tmp/metasrv/"
bind_addr = "127.0.0.1:3002"
# The communication server address for frontend and datanode to connect to metasrv, "127.0.0.1:3002" by default for localhost.
server_addr = "127.0.0.1:3002"
# Store server address, "127.0.0.1:2379" by default with etcd store.
# Store server address
# Configure the address based on your backend type, for example:
# - Use "127.0.0.1:2379" to connect to etcd
# - Use "password=password dbname=postgres user=postgres host=localhost port=5432" to connect to postgres
store_addr = "127.0.0.1:2379"
# Datanode selector type.
# - "lease_based" (default value).
Expand All @@ -690,10 +693,10 @@ use_memory_store = false
enable_region_failover = false
# The datastore for metasrv.
## Available datastore:
## - "EtcdStore" (default)
## - "MemoryStore" (In memory metadata storage - only used for testing.)
## - "PostgresStore"
backend = "EtcdStore"
## - "etcd_store" (default)
## - "memory_store" (In memory metadata storage - only used for testing.)
## - "postgres_store"
backend = "etcd_store"

## Procedure storage options.
[procedure]
Expand Down Expand Up @@ -803,10 +806,11 @@ backoff_deadline = "5mins"
| `data_home` | String | `/tmp/metasrv/` | The working home directory. |
| `bind_addr` | String | `127.0.0.1:3002` | The bind address of metasrv. |
| `server_addr` | String | `127.0.0.1:3002` | The communication server address for frontend and datanode to connect to metasrv, "127.0.0.1:3002" by default for localhost. |
| `store_addrs` | Array | `["127.0.0.1:2379"]` | Store server address (default to etcd) store. |
| `store_addrs` | Array | `["127.0.0.1:2379"]` | Store server address. Configure the address based on your backend type, for example:<br/>- Use `"127.0.0.1:2379"` to connect to etcd<br/>- Use `"password=password dbname=postgres user=postgres host=localhost port=5432"` to connect to postgres |
| `selector` | String | `lease_based` | Datanode selector type.<br/>- `lease_based` (default value).<br/>- `load_based`<br/>For details, see [Selector](/contributor-guide/metasrv/selector.md) |
| `use_memory_store` | Bool | `false` | Store data in memory. |
| `enable_region_failover` | Bool | `false` | Whether to enable region failover.<br/>This feature is only available on GreptimeDB running on cluster mode and<br/>- Using Remote WAL<br/>- Using shared storage (e.g., s3). |
| `backend` | String | `etcd_store` | The datastore for metasrv.<br/>- `etcd_store` (default)<br/>- `memory_store` (In memory metadata storage - only used for testing.)<br/>- `postgres_store` |
| `procedure` | -- | -- | Procedure storage options. |
| `procedure.max_retry_times` | Integer | `12` | Procedure max retry time. |
| `procedure.retry_delay` | String | `500ms` | Initial retry delay of procedures, increases exponentially |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,9 @@ bind_addr = "127.0.0.1:3002"
# frontend 和 datanode 连接到 metasrv 的通信服务器地址,本地默认为 "127.0.0.1:3002"。
server_addr = "127.0.0.1:3002"
# metasrv 存储端服务器地址,默认为 "127.0.0.1:2379"。
# 根据你的存储服务器类型配置地址,例如:
# - 使用 "127.0.0.1:2379" 连接到 etcd
# - 使用 "password=password dbname=postgres user=postgres host=localhost port=5432" 连接到 postgres
store_addr = "127.0.0.1:2379"
# Datanode 选择器类型。
# - "lease_based" (默认值)
Expand All @@ -679,10 +682,10 @@ use_memory_store = false
enable_region_failover = false
# metasrv 的数据库类型.
## 可选项:
## - "EtcdStore" (默认值)
## - "MemoryStore" (纯内存存储 - 仅用于测试)
## - "PostgresStore"
backend = "EtcdStore"
## - "etcd_store" (默认值)
## - "memory_store" (纯内存存储 - 仅用于测试)
## - "postgres_store"
backend = "etcd_store"

## Procedure 选项
[procedure]
Expand Down Expand Up @@ -774,10 +777,11 @@ backoff_deadline = "5mins"
| `data_home` | String | `/tmp/metasrv/` | 工作目录。 |
| `bind_addr` | String | `127.0.0.1:3002` | Metasrv 的绑定地址。 |
| `server_addr` | String | `127.0.0.1:3002` | 前端和 datanode 连接到 Metasrv 的通信服务器地址,默认为本地主机的 `127.0.0.1:3002`|
| `store_addrs` | Array | `["127.0.0.1:2379"]` | 元数据服务地址,默认值为 `["127.0.0.1:2379"]`。支持配置多个服务地址,格式为 `["ip1:port1","ip2:port2",...]`。默认使用 Etcd 做为元数据后端。 |
| `store_addrs` | Array | `["127.0.0.1:2379"]` | 元数据服务地址,默认值为 `["127.0.0.1:2379"]`。支持配置多个服务地址,格式为 `["ip1:port1","ip2:port2",...]`。默认使用 Etcd 做为元数据后端。<br/>根据你的存储服务器类型配置地址,例如:<br/>- 使用 `"127.0.0.1:2379"` 连接到 etcd<br/>- 使用 `"password=password dbname=postgres user=postgres host=localhost port=5432"` 连接到 postgres |
| `selector` | String | `lease_based` | 创建新表时选择 datanode 的负载均衡策略,详见 [选择器](/contributor-guide/metasrv/selector.md)|
| `use_memory_store` | Boolean | `false` | 仅用于在没有 etcd 集群时的测试,将数据存储在内存中,默认值为 `false`|
| enable_region_failover | Bool | false | 是否启用 region failover。<br/>该功能仅在以集群模式运行的 GreptimeDB 上可用,并且<br/>- 使用远程 WAL<br/>- 使用共享存储(如 s3)。 |
| `backend` | String | `etcd_store` | 元数据存储类型。<br/>- `etcd_store` (默认)<br/>- `memory_store` (纯内存存储 - 仅用于测试)<br/>- `postgres_store`|
| `procedure` | -- | -- | |
| `procedure.max_retry_times` | 整数 | `12` | Procedure 的最大重试次数。 |
| `procedure.retry_delay` | 字符串 | `500ms` | Procedure 初始重试延迟,延迟会指数增长。 |
Expand Down

0 comments on commit c6c5778

Please sign in to comment.