You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
docs: document new dedicated HTTP API server port (http.enable_api_server) (#2670)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Ning Sun <sunng@protonmail.com>
Co-authored-by: dennis zhuang <killme2008@gmail.com>
Copy file name to clipboardExpand all lines: docs/reference/http-endpoints.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,37 @@ description: Provides a full list of HTTP paths and their usage in GreptimeDB, i
5
5
6
6
# HTTP API Endpoint List
7
7
8
+
GreptimeDB provides two HTTP servers:
9
+
10
+
| Server | Default address | Purpose |
11
+
|--------|----------------|---------|
12
+
|**Main HTTP server**|`127.0.0.1:4000`| Internal / operational use. Serves all paths, including admin endpoints such as `/health`, `/metrics`, `/config`, and `/debug/*`, as well as all `/v1` and `/dashboard` paths. Keep this port private and accessible only by trusted operators. |
13
+
|**Public HTTP API server**|`127.0.0.1:4006`| User-facing access. Serves only `/v1` APIs and `/dashboard`. Safe to expose to database end-users. Disabled by default; enable it with `http.enable_api_server = true` in your configuration file. |
14
+
15
+
We recommend keeping the main HTTP server port for internal/operational use only. Alternatively, it can be safely exposed through an HTTP proxy, provided direct access is restricted and the proxy allows only the required protocols. But If you want to expose GreptimeDB as a service to end-users, enable the dedicated public API server and expose only its port.
16
+
17
+
```toml
18
+
[http]
19
+
# Main HTTP server — keep this internal
20
+
addr = "127.0.0.1:4000"
21
+
22
+
# Enable the public API server and bind it to an externally accessible address
23
+
enable_api_server = true
24
+
api_server_addr = "0.0.0.0:4006"
25
+
```
26
+
27
+
See the [configuration documentation](/user-guide/deployments-administration/configuration.md#protocol-options) for all `[http]` options.
28
+
8
29
Here is the full list for the various HTTP paths and their usage in GreptimeDB:
9
30
10
31
## Admin APIs
11
32
12
33
Endpoints that is not versioned (under `/v1`). For admin usage like health check, status, metrics, etc.
13
34
35
+
:::note
36
+
Admin API endpoints are available **only** on the main HTTP server (default port `4000`). They are not exposed by the dedicated public API server even when `http.enable_api_server` is enabled.
Protocol options are valid in `frontend` and `standalone` subcommands,
191
191
specifying protocol server addresses and other protocol-related options.
192
+
In particular, `http.enable_api_server` lets you start a dedicated public HTTP API server that serves only the `/v1` APIs and `/dashboard`, while keeping the main HTTP server for internal and operational endpoints.
193
+
This separation is useful when you want to expose GreptimeDB to end users or applications without also exposing admin paths such as health, metrics, config, or debug endpoints.
194
+
To use it, set `http.enable_api_server = true` and configure `http.api_server_addr` to the address you want to expose externally, while keeping `http.addr` private for operator access.
192
195
193
196
:::tip NOTE
194
197
The HTTP protocol configuration is available for all GreptimeDB components: `frontend`, `datanode`, `flownode`, and `metasrv`.
|| experimental_enable_explain_analyze_stream | Boolean | Experimental: enable `POST /v1/sql/analyze/stream` for streaming `EXPLAIN ANALYZE VERBOSE` metrics, true by default. |
290
+
|| enable_api_server | Boolean | Whether to start the dedicated public HTTP API server. This server serves only the `/v1` APIs and `/dashboard`, making it safe to expose to end users. The main HTTP server (`addr`) is intended for internal use. Disabled by default; set to `true` to enable. |
291
+
|| api_server_addr | String | The address to bind the dedicated public HTTP API server, `"127.0.0.1:4006"` by default. Only takes effect when `enable_api_server` is `true`. |
284
292
| grpc ||| gRPC server options |
285
293
|| bind_addr | String | The address to bind the gRPC server, "127.0.0.1:4001" by default |
286
294
|| runtime_size | Integer | The number of server worker threads, 8 by default |
## Enable the dedicated public HTTP API server (serves /v1 and /dashboard only).
835
+
enable_api_server = false
836
+
api_server_addr = "127.0.0.1:4006"
826
837
827
838
## Procedure storage options.
828
839
[procedure]
@@ -971,6 +982,8 @@ timeout = "3s"
971
982
|`http.addr`| String |`127.0.0.1:4000`| HTTP server address. |
972
983
|`http.timeout`| String |`0s`| HTTP request timeout. Set to `0s` to disable timeout. |
973
984
|`http.body_limit`| String |`64MB`| HTTP max body size. |
985
+
|`http.enable_api_server`| Bool |`false`| Whether to start the dedicated public HTTP API server. When enabled, a separate server is started at `api_server_addr` that serves only `/v1` APIs and `/dashboard`. The main HTTP server is kept for internal use. |
986
+
|`http.api_server_addr`| String |`127.0.0.1:4006`| The address to bind the dedicated public HTTP API server. Only takes effect when `enable_api_server` is `true`. |
974
987
|`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`<br/>- `mysql_store`|
975
988
|`meta_table_name`| String |`greptime_metakv`| Table name in RDS to store metadata. Effect when using a RDS kvbackend.<br/>**Only used when backend is RDS kvbackend.**|
976
989
|`meta_schema_name`| String | -- | Optional PostgreSQL schema for metadata table and election table name qualification. When PostgreSQL public schema is not writable (e.g., PostgreSQL 15+ with restricted public), set this to a writable schema. GreptimeDB will use `meta_schema_name.meta_table_name`.<br/>**Only used when backend is `postgres_store`.**|
0 commit comments