infra-clickhouse

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ClickHouse with clickhousectl

使用clickhousectl管理ClickHouse

clickhousectl
manages ClickHouse in two environments:
  • Local — ClickHouse installed and running on the user's machine, for development.
  • Cloud — managed ClickHouse Cloud services, for production: fully managed, automatic scaling, backups, and upgrades.
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
在两种环境中管理ClickHouse:
  • 本地环境——在用户机器上安装并运行ClickHouse,用于开发。
  • 云端环境——托管式ClickHouse Cloud服务,用于生产:全托管、自动扩容、备份和升级。
本文档会引导你找到对应的参考文档。分步工作流位于
ref/local.md
ref/cloud.md
中——在运行命令前,请阅读与用户场景匹配的文档。

Which reference to use

选择合适的参考文档

The user wants to...Read
Build an app with ClickHouse, develop or prototype locally, no cloud account neededref/local.md
Go to production, host a managed ClickHouse, or use ClickHouse Cloud explicitlyref/cloud.md
Operate an existing cloud service (schemas, users, queries against it)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 ClickHouse for my app"), default to local for development tasks and ask before creating anything in the cloud — cloud services cost money.
用户需求...阅读文档
使用ClickHouse构建应用、本地开发或原型开发,无需云端账户ref/local.md
部署到生产环境、托管ClickHouse,或明确使用ClickHouse Cloudref/cloud.md
操作现有云端服务(schema、用户、针对它的查询)ref/cloud.md
先本地开发,之后部署到生产环境ref/local.md开始;当准备部署到生产环境时,文档会指向ref/cloud.md
如果需求确实不明确(例如“为我的应用设置ClickHouse”),开发任务默认选择本地环境,在创建任何云端资源前请先询问用户——云端服务会产生费用。

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

相关内容

  • When designing schemas, consult the
    clickhouse-best-practices
    skill for ORDER BY selection, data types, and partitioning.
  • For Postgres (local development or managed ClickHouse Cloud Postgres), use the
    infra-postgres
    skill.
  • 设计schema时,请参考
    clickhouse-best-practices
    技能,了解ORDER BY选择、数据类型和分区策略。
  • 对于Postgres(本地开发或托管式ClickHouse Cloud Postgres),请使用
    infra-postgres
    技能。