infra-postgres

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Postgres with clickhousectl

使用clickhousectl管理Postgres

clickhousectl
manages Postgres in two environments:
  • Local — named, Docker-backed Postgres instances on the user's machine, for development.
  • Cloud — managed Postgres services in ClickHouse Cloud (beta), for production: HA, read replicas, point-in-time restore.
This file routes to the right reference. The step-by-step workflows live in
ref/local.md
and
ref/cloud.md
— read the one that matches the user's situation before running commands.
clickhousectl
在两种环境中管理Postgres:
  • 本地环境 —— 在用户机器上创建基于Docker的命名Postgres实例,用于开发。
  • 云环境 —— ClickHouse Cloud(测试版)中的托管Postgres服务,适用于生产环境:支持高可用(HA)、只读副本、时间点恢复。
本文档会引导你找到对应的参考文档。分步操作流程位于
ref/local.md
ref/cloud.md
中——在运行命令前,请阅读与用户场景匹配的文档。

Which reference to use

选择合适的参考文档

The user wants to...Read
Develop or prototype locally, run tests/CI against Postgres, no cloud account neededref/local.md
Go to production, host a managed Postgres, or use ClickHouse Cloud explicitlyref/cloud.md
Operate an existing cloud service (passwords, TLS, config, replicas, failover, restore)ref/cloud.md
Develop locally now, ship to production laterStart with ref/local.md; it points to ref/cloud.md when it's time to go to prod
If it's genuinely ambiguous (e.g. "set up Postgres for my app"), default to local for development tasks and ask before creating anything in the cloud — cloud services cost money.
用户需求阅读文档
本地开发或原型开发、针对Postgres运行测试/CI、无需云账户ref/local.md
部署到生产环境、托管Postgres服务,或明确使用ClickHouse Cloudref/cloud.md
操作现有云服务(密码、TLS、配置、副本、故障转移、恢复)ref/cloud.md
先进行本地开发,后续部署到生产环境ref/local.md开始;当准备部署到生产环境时,文档会指引你查看ref/cloud.md
如果需求不明确(例如“为我的应用搭建Postgres”),默认优先选择本地开发方案,并在创建云服务前询问用户——云服务会产生费用。

Prerequisites (both workflows)

前置条件(两种流程通用)

Check that
clickhousectl
is installed:
bash
which clickhousectl
If not found, install it:
bash
curl -fsSL https://clickhouse.com/cli | sh
This installs to
~/.local/bin/clickhousectl
(with a
chctl
alias). If the command is still not found, suggest
export PATH="$HOME/.local/bin:$PATH"
or a new terminal.
All commands accept
--json
for machine-readable output. Exit codes follow
gh
conventions: 0 success, 1 error, 2 cancelled, 4 auth required.
检查是否已安装
clickhousectl
bash
which clickhousectl
如果未找到,请执行以下命令安装:
bash
curl -fsSL https://clickhouse.com/cli | sh
安装路径为
~/.local/bin/clickhousectl
(带有
chctl
别名)。如果安装后仍无法找到该命令,建议执行
export PATH="$HOME/.local/bin:$PATH"
或重启终端。
所有命令均支持
--json
参数以输出机器可读格式。退出码遵循
gh
约定:0表示成功,1表示错误,2表示取消,4表示需要认证。

Related

相关内容

  • To replicate Postgres data into ClickHouse for analytics, see ClickPipes (
    clickhousectl cloud clickpipe --help
    ).
  • For ClickHouse itself (local development or ClickHouse Cloud services), use the
    infra-clickhouse
    skill.
  • 如需将Postgres数据复制到ClickHouse进行分析,请查看ClickPipes(执行
    clickhousectl cloud clickpipe --help
    获取帮助)。
  • 如需使用ClickHouse本身(本地开发或ClickHouse Cloud服务),请使用
    infra-clickhouse
    技能。