From c6c5778d022306e04b9cf07e652a818fa7b9749b Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Tue, 7 Jan 2025 15:36:29 +0800 Subject: [PATCH] feat: add postgres kvbackend config docs (#1435) --- docs/user-guide/deployments/configuration.md | 16 ++++++++++------ .../user-guide/deployments/configuration.md | 14 +++++++++----- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/docs/user-guide/deployments/configuration.md b/docs/user-guide/deployments/configuration.md index 650945b8a..db7815d05 100644 --- a/docs/user-guide/deployments/configuration.md +++ b/docs/user-guide/deployments/configuration.md @@ -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). @@ -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] @@ -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:
- 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 | | `selector` | String | `lease_based` | Datanode selector type.
- `lease_based` (default value).
- `load_based`
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.
This feature is only available on GreptimeDB running on cluster mode and
- Using Remote WAL
- Using shared storage (e.g., s3). | +| `backend` | String | `etcd_store` | The datastore for metasrv.
- `etcd_store` (default)
- `memory_store` (In memory metadata storage - only used for testing.)
- `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 | diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments/configuration.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments/configuration.md index b6cd3f872..8c4741da4 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments/configuration.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments/configuration.md @@ -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" (默认值) @@ -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] @@ -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 做为元数据后端。
根据你的存储服务器类型配置地址,例如:
- 使用 `"127.0.0.1:2379"` 连接到 etcd
- 使用 `"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。
该功能仅在以集群模式运行的 GreptimeDB 上可用,并且
- 使用远程 WAL
- 使用共享存储(如 s3)。 | +| `backend` | String | `etcd_store` | 元数据存储类型。
- `etcd_store` (默认)
- `memory_store` (纯内存存储 - 仅用于测试)
- `postgres_store`| | `procedure` | -- | -- | | | `procedure.max_retry_times` | 整数 | `12` | Procedure 的最大重试次数。 | | `procedure.retry_delay` | 字符串 | `500ms` | Procedure 初始重试延迟,延迟会指数增长。 |