Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions dir.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@
- title_en: Cluster Configuration
title_cn: 集群配置
path: admin/configuration-fields/node
- title_en: Query Configuration
title_cn: 查询配置
path: admin/configuration-fields/query
- title_en: Scheduler Configuration
title_cn: 调度器配置
path: admin/configuration-fields/scheduler
Expand Down Expand Up @@ -497,6 +500,9 @@
- title_en: Audit Logs
title_cn: 审计日志
path: user-security/audit-logs
- title_en: Password Policy
title_cn: 密码策略
path: user-security/password-policy
- title_en: Release Notes
title_cn: 版本发布说明
collapsed: true
Expand Down
Empty file.
Empty file.
1 change: 1 addition & 0 deletions zh_CN/admin/capacity-model.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 容量模型

Datalayers 存算分离架构,为了充分使用系统资源、达到最高性能,需对系统关键概念了解熟悉,结合业务场景进行合理建模。
本章节重点介绍如何建模。

Expand Down
4 changes: 2 additions & 2 deletions zh_CN/admin/configuration-fields/license.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
# when no `key` is specified, the `file` configuration will be used.
[license]
# A trial license key which may be deprecated.
key = "eyJ2IjoxLCJ0IjoxLCJjbiI6Iua+nOWbvuacquadpe+8iOaIkOmDve+8ieaVsOaNruenkeaKgOaciemZkOWFrOWPuCIsImNlIjoieWluYm8ueWFuZ0BkYXRhbGF5ZXJzLmlvIiwic2QiOiIyMDI1MDUwOSIsInZkIjoyMzYsIm5sIjozLCJjbCI6MzAsImVsIjoxMDAwMDAsImZzIjpbXX0K.e1gDGsCpvPA1fy/j2JUDvuug/kxJQyuAan0fIn3gGmFL1JUQ3V1bsi73jVl6R3wBkxMbJ13tWdBcTYZREVCVjqy22HvcSkGYJqKiQ0qx2jP2Zq22z2oiO/3frs0xuMdF6g5IE9C6PQq5X/OeFi6eFSTze4mcJhc5DaeB176oSqkyyAf+aKS23ncybYE2Nb55tkKwEVkWao3guMVhIsySInE0PXlaRYuAwmMsA0laYt1C1ZX+ktBu4CI/+C9tH6BvmkvPEagayjoITzjqdx9YRjM7/c8cSa159thLqYzvfQlLXX48bua5DS16KETk19BBc/uaHZxYXzSE1wYXFArjKw=="
key = "eyJ2IjoxLCJ0IjoxLCJjbiI6IkRhdGFsYXllcnMiLCJjZSI6InlpbmJvLnlhbmdAZGF0YWxheWVycy5pbyIsInNkIjoiMjAyNTEyMTUiLCJ2ZCI6MTgyLCJubCI6NSwiY2wiOjEwMDAsImVsIjoxMDAwMDAwMCwiZnMiOltdfQo=.a3GoQ3tQ2q/DyZxTaX6M5HLuNT64/IoMfgEML+dZBTwEy0SNvG0nQesJhAssw9TlTyh5FKuqfWQsBmS3JMbtub+LNB1YF51TB19dd8qv3UKT/FZg4TWql+drtFxRZPPVLg1QZA7vV11OWZWSg5Id3ZDskXOw1Fn1pWTDO8GC4hfqQQvMclYmfmLYrkkEv8+cikqTiv2DU5zzV+Oca2emKTYOJ5Ti9wYtD/2gu0niekCXgjRblDFa9Yauypqo/v2oE/6R7zqPOxre1EjqdCtmURRtMdievOwubXYpBljt/LJ079sY/3wgYq65L65rdpW+/u9PdwFIz9AIsgM1dV1lkQ=="

# The path of license file,
# Default: "/var/lib/datalayers/license/key.lic"
file = "/var/lib/datalayers/license/key.lic"
# file = "/var/lib/datalayers/license/key.lic"
```
8 changes: 4 additions & 4 deletions zh_CN/admin/configuration-fields/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ rotation = "DAILY"

# 日志是否输出到标准输出中,在容器中,将默认输出到标准输出
# Default: true.
enable_stdout = true
enable_stdout = false

# Enables logging to files if set to true.
# Default: false.
enable_file = false
enable_file = true

# 设置错误日志是否启用单独的文件文件存储.
# Default: false.
enable_err_file = false
enable_err_file = true

# Makes the logging more verbose by inserting line number and file name.
# Default: true.
verbose = true
verbose = false
```
2 changes: 1 addition & 1 deletion zh_CN/admin/configuration-fields/node.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 节点配置

`node` 部分配置 Datalayers 集群中节点的行为和属性。节点的配置确保正确的标识、角色分配、超时设置、连接管理和数据存储。以下是具体的配置项:
`node` 配置是 Datalayers 集群中节点的行为和属性。节点的配置确保正确的标识、角色分配、超时设置、连接管理和数据存储。

## 配置示例

Expand Down
35 changes: 35 additions & 0 deletions zh_CN/admin/configuration-fields/query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 查询配置

`query` 配置组用于管理 Datalayers 的查询行为。主要包括 `内存资源控制` 和 `慢查询日志记录`。

## 配置示例

```toml
# 查询相关配置
[query]

# 内存池大小,用于限制查询操作的总内存使用量
# 建议设置为系统可用内存的 60% ~ 80%
# 默认值:主机可用内存的 60%
# 示例:memory_pool_size = "8GB"
# memory_pool_size = "8GB"

# 慢查询日志配置
[query.slow_query]

# 是否启用慢查询日志记录功能
# 默认值:false
# enable = true

# 慢查询时间阈值,执行时间超过此阈值的查询将被记录
# 默认值:"5s"(5秒)
# 支持的时间单位:ns(纳秒)、us(微秒)、ms(毫秒)、s(秒)、m(分钟)、h(小时)
# 示例:threshold = "1s"、threshold = "500ms"、threshold = "2m"
# threshold = "5s"

# 慢查询采样比例,用于控制记录的慢查询数量
# 默认值:1.0(记录所有慢查询)
# 有效范围:(0.0, 1.0]
# 示例:sample_ratio = 0.1(记录10%的慢查询)
# sample_ratio = 1.0
```
94 changes: 51 additions & 43 deletions zh_CN/admin/configuration-fields/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,32 @@
## 配置示例

```toml
# Datalayers' configurations.
# The root directory of all local data storage paths
base_dir = "/var/lib/datalayers"

# The configurations of Datalayers server.
[server]
# 指定服务是以 单机/集群 模式启动.
# - true: 单机模式.
# - false: 集群模式.
# In which mode to start the Datalayers server.
# - true: standalone mode.
# - false: cluster mode.
# Default: false.
standalone = false

# 配置 Arrow FlightSQL 的监听地址.
# The Arrow FlightSql endpoint of the server.
# Users are expected to connect to this endpoint for communicating with the server through the Arrow FlightSql protocol.
# Default: "0.0.0.0:8360".
addr = "0.0.0.0:8360"

# 配置 HTTP 服务的舰艇地址.
# The HTTP endpoint of the server.
# Default: "0.0.0.0:8361".
http = "0.0.0.0:8361"

# 配置 session 超时时间.
# A session is regarded timeout if it's not active in the past `session_timeout` duration.
# Default: "10s".
session_timeout = "10s"

# The timezone the server lives in.
# Default is Asia/Shanghai, if timezone not exist in configuration, we will use the machine local time.
timezone = "Asia/Shanghai"

# 配置 TLS 信息.
# The configurations of tls certificates.
[server.tls]
# The key file for services with tls, both for https and flightsql
#key = "/etc/datalayers/certs/server.key"
Expand All @@ -56,48 +53,40 @@ username = "admin"
password = "public"

# The provided JSON Web Token.
# Default: "87113c3d906df75e9c6389fbd457d957".
jwt_secret = "87212c3d906df71e9c6289fbd456d917"

# 密码强度,支持三种:
# weak: 弱密码,没有特殊要求;
# moderate: 一般密码,至少 8 位字符,至少包含大写、小写、数字和特殊字符中的三种;
# strong: 强密码,至少 14 位字符,包含大写、小写、数字和特殊字符。
# 默认:weak
# Default: "871b3c2d706d875e9c6389fb2457d957".
jwt_secret = "871b3c2d706d875e9c6389fb2457d957"

# Password strength requirements.
# weak: no requirements, simple password.
# moderate: at least 8 characters, including at least three types of the following:
# uppercase letters, lowercase letters, digits, and special characters.
# strong: at least 14 characters, including all types of the following:
# uppercase letters, lowercase letters, digits, and special characters.
# Default: "weak"
#password_strength = "weak"

# 防暴力破解密码
# 形式为 "a/b/c",a,b,c 都是整数,含义是连续失败 a 次后,b 分钟内禁止该用户重复尝试登录,之后每再失败一次,禁止时间延长 c 分钟。
# a最大值为 10,b,c 最大值为 120 分钟。
# 默认:0/0/0 表示不开启防暴力破解
# Password protection against brute-force attacks.
# Form as "a/b/c", means:
# Account locked for "b" minutes after "a" failed password attempts,
# and locked for another "c" miniutes after the each failed attempt.
# The maximum of a/b/c is 10/120/120 respectively, and will be set to 3/5/5 if too big.
# 0/-/- means no lockout.
# Default: "0/0/0"
#password_lockout = "3/5/5"

# The configurations of the unix domain socket server.
[server.uds]
# Unix Domain Socket 的文件路径,指定相对路径则是相对 `base_dir`.
# 不配置表示不开启此服务,默认为不开启。
# 建议配置项: "run/datalayers.sock"
# path = "run/datalayers.sock"

# The configurations of the Prometheus server.
[server.prometheus]
# The Prometheus endpoint.
# Default: "0.0.0.0:9090"
# addr = "0.0.0.0:9090"

# The default memtable size for auto-created metric tables.
# memtable_size = "5MB"

# The default TTL for auto-created metric tables.
# ttl = "356d"
# The path of the unix domain socket, relative to `base_dir`.
# DONOT configure this options means do not support uds server by default.
# Recommend: "run/datalayers.sock"
path = "run/datalayers.sock"

# The configurations of the Redis service.
[server.redis]
# 配置 Key-Value 服务的监听地址.
# Key-Value 服务仅在集群模式下才能工作.
# 默认情况下不启动 Key-Value 服务.
# Users can start this service only when Datalayers server starts in cluster mode.
# Do not support redis service by default.
# Default: "".
# addr = "0.0.0.0:6379"
# addr = "0.0.0.0:8362"

# The username.
# Default: "admin".
Expand All @@ -106,4 +95,23 @@ jwt_secret = "87212c3d906df71e9c6289fbd456d917"
# The password.
# Default: "public".
#password = "public"

# The configurations of the Prometheus server.
[server.prometheus]
# The Prometheus endpoint.
# Default: "0.0.0.0:9090"
# addr = "0.0.0.0:9090"

# The default memtable size for auto-created metric tables.
memtable_size = "5MB"

# The default TTL for auto-created metric tables.
ttl = "356d"

# The configurations of the Postgres sql service.
[server.postgres]
# The endpoint of the server.
# Don't support postgres protocol by default.
# Recommend: "0.0.0.0:5432".
#addr = "0.0.0.0:5432"
```
62 changes: 46 additions & 16 deletions zh_CN/admin/datalayers-cli.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
# 交互终端概述

Datalayers CLI 交互终端(dlsql)是与 Datalayers 数据库进行交互的命令行工具。该工具已包含在 Datalayers 的镜像和安装包中,提供 SQL 执行和系统管理功能。
Datalayers CLI 交互终端(dlsql)是与 Datalayers 数据库进行交互的命令行工具,支持 SQL(兼容 MySQL 方言) 与 [PRQL](https://prql-lang.org/) 进行交互,默认使用 SQL。该工具已包含在 Datalayers 的镜像和安装包中,提供 SQL 执行和系统管理功能。

Datalayers CLI 支持两种连接认证方式,用户可根据实际场景选择。

## 基于帐号密码认证
## 交互语言

dlsql 默认使用 SQL 语言(MySQL 方言)进行交互,同时支持 [PRQL](https://prql-lang.org/),可在 dlsql 交互式终端内通过 `set dialect = prql` 指定,将交互语言指定为 PRQL,如需切换回 SQL, 则执行 `set dialect = sql` 即可。

```sql
# 使用 prql 做为查询语言
> set dialect = prql

# 使用 SQL 做为查询语言
> set dialect = sql

```

注:该查询语言目前为客户端行为,因此暂时仅支持 `dlsql` 中使用

## 连接认证方式

### 帐号密码认证

适用于远程或本地 TCP/IP 连接,提供灵活的身份验证。在终端中执行以下命令进入交互式界面:

```shell
dlsql -h 127.0.0.1 -u admin -p public -P 8360
```

## 基于 Peer 认证
### Peer 认证

Linux 的 Peer 认证(Peer Credentials Authentication)是基于内核级别的进程身份验证机制,通过 `Unix Domain Socket` 通信为连接方提供可靠的身份验证。

Expand Down Expand Up @@ -44,18 +61,31 @@ sudo -u datalayers dlsql
- **权限**:通过 Peer 认证建立的连接将获得系统级最高权限
- 配置 `Unix Socket` 服务后,需重启 Datalayers,以确保服务生效

## WEB 控制台

dlsql 内置 WEB 控制台,提供可视化操作界面。

启动命令如下:

```shell
dlsql --web-console 9362
```

启动后,通过 `http://<服务器地址>:9362` 即可访问 WEB 控制台,帐号与密码为数据库对应的帐号与密码。

## 连接参数详解

| 参数 | 简写 | 描述 |
| ---------- | ------- | ---------------------------------------------------------------------------------------------- |
| --host | -h | 设置连接 Datalayers 服务器地址, 默认为本地路径通过 Unix Socket 方式连接: /var/lib/datalayers/run/datalayers.sock |
| --username | -u | 设置连接 Datalayers 使用的用户名 |
| --password | -p | 设置连接 Datalayers 使用的密码 |
| --port | -P | 设置连接 Datalayers 的端口 |
| --database | -d | 设置连接 Datalayers 时使用的数据库 |
| --execute | -e | 运行一次 SQL STATEMENT后退出 |
| --load-file | | 执行指定的 SQL 脚本文件 |
| --version | -V | 显示 CLI 工具的版本 |
| --tls | | 通过 TLS 加密方式与数据库进行交互。自签证书则需指定 root ca,如:--tls /etc/datalayers/datalayers.crt |
| --max-display-rows | | 在使用 `dlsql` 查询数据时最多显示多少条记录,缺省值为: `40`,如需显示更多记录,则需通过该参数进行指定(`0` 表示无限制) |
| --help | | show this help, then exit |
| 参数 | <div style="width:28px">简写 </div> | 描述 |
| ---------- | ------------------------------------ | ---------------------------------------------------------------------------------------------- |
| --host | -h | 设置连接 Datalayers 服务器地址, 默认为本地路径通过 Unix Socket 方式连接: /var/lib/datalayers/run/datalayers.sock |
| --username | -u | 设置连接 Datalayers 使用的用户名 |
| --password | -p | 设置连接 Datalayers 使用的密码 |
| --port | -P | 设置连接 Datalayers 的端口 |
| --database | -d | 设置连接 Datalayers 时使用的数据库 |
| --execute | -e | 运行一次 SQL STATEMENT后退出 |
| --load-file | | 执行指定的 SQL 脚本文件 |
| --web-console | | 指定 WEB 控制台的监听端口并启动 WEB 控制台 |
| --version | -V | 显示 CLI 工具的版本 |
| --tls | | 通过 TLS 加密方式与数据库进行交互。自签证书则需指定 root ca,如:--tls /etc/datalayers/datalayers.crt |
| --max-display-rows | | 在使用 `dlsql` 查询数据时最多显示多少条记录,缺省值为: `40`,如需显示更多记录,则需通过该参数进行指定(`0` 表示无限制) |
| --help | | show this help, then exit |
Loading