Before you start
A warehouse needs a subnet of a VPC. It’s reached only from inside the VPC:
there’s no public address. To connect from your laptop, use
ezgh warehouse connect.
Its first user’s password goes to a new Secret in the project, written as you, so creating
a warehouse also needs secrets.secrets.create and secrets.versions.create in the project.
Create
- Open Warehouse and choose Create warehouse.
- Pick a name, a ClickHouse version, and the number of shards and replicas.
- Pick an instance type, storage and a subnet.
- Set backups, the maintenance window and deletion protection, then choose Create warehouse.
ezgh warehouse warehouses create analytics --engine-version 26.8 --shards 2 --replicas 2 \
--instance-type gp-1.large --storage-size-gib 500 --subnet sbn_2m9x0a7qpe4k --waitA create takes minutes, and --wait waits until the warehouse is available. The warehouse exists
from the start, creating, with its ID (whs_…). Its endpoint is null until its name resolves.
The warehouse comes with the default database and one user, app, with the admin preset, whose
password is in a Secret. See Users and grants.
Settings
| Setting | |
|---|---|
engineVersion |
ezgh warehouse warehouses engine-versions lists them. Upgrades move to a newer one. |
shards |
1 to 8. See Sharding. Can grow later. |
replicas |
Copies of each shard, 1 to 3. Each shard keeps serving through the loss of one node with 2 or 3 replicas. Can grow later. |
keeper |
The Keeper mode. |
instanceType |
The size of each node, with at least 8 GiB of memory; every node has the same one. Can change later. |
storage |
Each node’s storage: sizeGiB, and optionally iops and throughputMBps. Can grow later. |
subnet |
The subnet it’s in. Fixed. |
allowedSourceCidrs |
Who can connect. |
plaintextPort |
Whether ports 8123 (HTTP) and 9000 (native) also serve without TLS. See Connect. |
backups |
enabled, retentionDays (1–35, 7 by default) and windowUtc. See Backups. |
maintenance.windowUtc |
The maintenance window. |
deletionProtection |
Refuses deletes of the warehouse and of its databases while on. |
Keeper mode
ClickHouse Keeper coordinates a warehouse’s replicas and its Replicated databases. keeper says
where it runs:
| Warehouse | keeper |
|---|---|
| 1 shard × 1 replica | null |
| 2 nodes (1 × 2 or 2 × 1) | dedicated |
| 3 or more nodes | dedicated (the default), or colocated when the instance type has at least 8 vCPUs and 32 GiB of memory and isn’t a shared vCPU type (gs-1) |
dedicated runs Keeper apart from your data. colocated runs it alongside your data. The mode can change later; see
Scaling.
Storage
Each node keeps its shard’s data on its own storage. A warehouse is storage_low when more than 85% of
a node’s storage is used, and the project’s notifications say so. Grow it while it
serves:
ezgh warehouse warehouses update whs_4k2m9x0a7qpe --storage-size-gib 1000 --waitStorage only grows. When a node’s storage is full, inserts to it fail.
Who can connect
By default, any address in the warehouse’s VPC can connect to its client ports. allowedSourceCidrs
narrows that to the ranges you list:
ezgh warehouse warehouses update whs_4k2m9x0a7qpe --allowed-source-cidr 10.0.1.0/24 \
--allowed-source-cidr 10.0.2.0/24 --waitThe client’s firewall also has to allow its outbound connection. A firewall
rule can name the warehouse as its peer (whs_4k2m9x0a7qpe) in place of its addresses.
Maintenance
Patch releases and other maintenance happen in the warehouse’s maintenance window
(maintenance.windowUtc, such as sun:06:00-sun:07:00), one node at a time.
Delete
ezgh warehouse warehouses delete whs_4k2m9x0a7qpe --waitDeleting a warehouse deletes its data, its databases and its backups. It’s refused while
deletionProtection is on.