-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1f426c
commit 8077b6e
Showing
16 changed files
with
245 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Administration | ||
|
||
This document addresses strategies and practices used in the operation of GreptimeDB systems and deployments. | ||
|
||
## Database/Cluster management | ||
|
||
* [Installation](/getting-started/installation/overview.md) for GreptimeDB and the [g-t-control](./gtctl.md) command line tool. | ||
* Database Configuration, please read the [Configuration](./configuration.md) reference. | ||
* [Monitoring](./monitoring.md) and [Tracing](./tracing.md) for GreptimeDB. | ||
* GreptimeDB [Backup & Restore methods](./back-up-\&-restore-data.md). | ||
|
||
### Runtime information | ||
|
||
* Find the topology information of the cluster though [CLUSTER_INFO](/reference/sql/information-schema/cluster-info.md) table. | ||
* Find the table regions distribution though [REGION_PEERS](/reference/sql/information-schema/region-peers.md) table. | ||
|
||
The `INFORMATION_SCHEMA` database provides access to system metadata, such as the name of a database or table, the data type of a column, etc. Please read the [reference](/reference/sql/information-schema/overview.md). | ||
|
||
## Data management | ||
|
||
* [The Storage Location](/user-guide/concepts/storage-location.md). | ||
* Cluster Failover for GreptimeDB by [Setting Remote WAL](./remote-wal/quick-start.md). | ||
* [Flush and Compaction for Table & Region](/reference/sql/functions#admin-functions). | ||
* Partition the table by regions, read the [Table Sharding](/contributor-guide/frontend/table-sharding.md) reference. | ||
* [Migrate the Region](./region-migration.md) for Load Balance. | ||
* [Expire Data by Setting TTL](/user-guide/concepts/features-that-you-concern#can-i-set-ttl-or-retention-policy-for-different-tables-or-measurements). | ||
|
||
## Best Practices | ||
|
||
TODO |
46 changes: 46 additions & 0 deletions
46
docs/nightly/en/user-guide/operations/back-up-&-restore-data.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,47 @@ | ||
# Back up & restore data | ||
|
||
Use [`COPY` command](/reference/sql/copy.md)to backup and restore data. | ||
|
||
## Backup Table | ||
|
||
Backup the table `monitor` in `parquet` format to the file `/home/backup/monitor/monitor.parquet`: | ||
|
||
```sql | ||
COPY monitor TO '/home/backup/monitor/monitor.parquet' WITH (FORMAT = 'parquet'); | ||
``` | ||
|
||
Backup the data in the time range: | ||
|
||
```sql | ||
COPY monitor TO '/home/backup/monitor/monitor_20240518.parquet' WITH (FORMAT = 'parquet', START_TIME='2024-05-18 00:00:00', END_TIME='2025-05-19 00:00:00'); | ||
``` | ||
|
||
The above command will export the data on `2024-05-18`. Use such command to achieve incremental backup. | ||
|
||
## Restore Table | ||
|
||
Restore the `monitor` table: | ||
|
||
```sql | ||
COPY monitor FROM '/home/backup/monitor/monitor.parquet' WITH (FORMAT = 'parquet'); | ||
``` | ||
|
||
If exporting the data every data incrementally, all the files under the same folder but with different file names, we can restore them with `PATTERN` option: | ||
|
||
```sql | ||
COPY monitor FROM '/home/backup/monitor/` WITH (FORMAT = 'parquet', PATTERN = '.*parquet') | ||
``` | ||
## Backup & Restore Database | ||
It's almost the same as the table: | ||
|
||
```sql | ||
-- Backup the database public -- | ||
COPY DATABASE public TO '/home/backup/public/' WITH (FORMAT='parquet'); | ||
-- Restore the database public -- | ||
COPY DATABASE public FROM '/home/backup/public/' WITH (FORMAT='parquet'); | ||
``` | ||
|
||
Look at the folder `/home/backup/public/`, the command exports each table as a separate file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# 管理 | ||
|
||
本文件介绍了在 GreptimeDB 系统运维和部署中使用的策略和实践。 | ||
|
||
## 数据库/集群管理 | ||
|
||
* GreptimeDB 的 [安装](/getting-started/installation/overview.md) 和 [g-t-control](./gtctl.md) 命令行工具。 | ||
* 数据库配置,请阅读 [配置](./configuration.md) 参考。 | ||
* GreptimeDB 的 [监控](./monitoring.md) 和 [链路追踪](./tracing.md)。 | ||
* GreptimeDB 的 [备份与恢复方法](./back-up-\&-restore-data.md)。 | ||
|
||
### 运行时信息 | ||
|
||
* 通过 [CLUSTER_INFO](/reference/sql/information-schema/cluster-info.md) 表查找集群的拓扑信息。 | ||
* 通过 [REGION_PEERS](/reference/sql/information-schema/region-peers.md) 表查找表的 Region 分布。 | ||
|
||
`INFORMATION_SCHEMA` 数据库提供了对系统元数据的访问,如数据库或表的名称、列的数据类型等。请阅读 [参考文档](/reference/sql/information-schema/overview.md)。 | ||
|
||
## 数据管理 | ||
|
||
* [存储位置说明](/user-guide/concepts/storage-location.md)。 | ||
* 通过 [设置Remote WAL](./remote-wal/quick-start.md) 实现 GreptimeDB 的集群容灾。 | ||
* [Table 和 Region 的 Flush 和 Compaction](/reference/sql/functions#admin-functions)。 | ||
* 通过 Region 对表进行分区,请阅读 [表的分片](./contributor-guide/frontend/table-sharding.md) 参考。 | ||
* [迁移 Region](./region-migration.md) 以实现负载均衡。 | ||
* [通过设置 TTL 过期数据](/user-guide/concepts/features-that-you-concern#can-i-set-ttl-or-retention-policy-for-different-tables-or-measurements)。 | ||
|
||
## 最佳实践 | ||
|
||
TODO |
48 changes: 47 additions & 1 deletion
48
docs/nightly/zh/user-guide/operations/back-up-&-restore-data.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,47 @@ | ||
TODO | ||
# 备份和恢复数据 | ||
|
||
使用 [`COPY` 命令](/reference/sql/copy.md) 来备份和恢复数据。 | ||
|
||
## 备份表 | ||
|
||
将表 `monitor` 以 `parquet` 格式备份到文件 `/home/backup/monitor/monitor.parquet`: | ||
|
||
```sql | ||
COPY monitor TO '/home/backup/monitor/monitor.parquet' WITH (FORMAT = 'parquet'); | ||
``` | ||
|
||
备份指定时间范围内的数据: | ||
|
||
```sql | ||
COPY monitor TO '/home/backup/monitor/monitor_20240518.parquet' WITH (FORMAT = 'parquet', START_TIME='2024-05-18 00:00:00', END_TIME='2025-05-19 00:00:00'); | ||
``` | ||
|
||
上述命令将导出 `2024-05-18` 的数据。可以使用此命令实现增量备份。 | ||
|
||
## 恢复表 | ||
|
||
恢复 `monitor` 表: | ||
|
||
```sql | ||
COPY monitor FROM '/home/backup/monitor/monitor.parquet' WITH (FORMAT = 'parquet'); | ||
``` | ||
|
||
如果每次增量导出数据,所有文件在同一文件夹下但文件名不同,可以使用 `PATTERN` 选项选中并恢复它们: | ||
|
||
```sql | ||
COPY monitor FROM '/home/backup/monitor/' WITH (FORMAT = 'parquet', PATTERN = '.*parquet'); | ||
``` | ||
|
||
## 备份和恢复数据库 | ||
|
||
和表的命令类似: | ||
|
||
```sql | ||
-- 备份数据库 public -- | ||
COPY DATABASE public TO '/home/backup/public/' WITH (FORMAT='parquet'); | ||
|
||
-- 恢复数据库 public -- | ||
COPY DATABASE public FROM '/home/backup/public/' WITH (FORMAT='parquet'); | ||
``` | ||
|
||
导出后,查看文件夹 `/home/backup/public/`,该命令将每个表导出为单独的文件。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters