ClickHouse/docs/en/engines/database-engines/replicated.md

50 lines
1.3 KiB
Markdown
Raw Normal View History

2021-06-05 06:46:30 +00:00
# Replicated {#replicated}
Supports replication of metadata via DDL log being written to ZooKeeper and executed on all of the replicas for a given database.
One Clickhouse server can have multiple replicated databases running and updating at the same time.
## Creating a Database {#creating-a-database}
``` sql
2021-06-05 08:10:37 +00:00
CREATE DATABASE testdb ENGINE = Replicated('zoo_path', 'replica_name')
2021-06-05 06:46:30 +00:00
```
**Engine Parameters**
2021-06-05 08:10:37 +00:00
- `zoo_path` — ZooKeeper path. The same ZooKeeper path corresponds to the same database.
2021-06-05 06:46:30 +00:00
- `replica_name` — Replica name. Replica names must be different for all replicas of the same database.
2021-06-05 08:10:37 +00:00
Using this engine, creation of Replicated tables requires no ZooKeeper path and replica name parameters. Table's replica name is the same as database replica name. Table's ZooKeeper path is a concatenation of database's ZooKeeper path, `/tables/`, and `UUID` of the table.
2021-06-05 06:46:30 +00:00
## Specifics and recommendations {#specifics-and-recommendations}
Algorithms
Specifics of read and write processes
Examples of tasks
Recommendations for usage
Specifics of data storage
## Usage Example {#usage-example}
The example must show usage and use cases. The following text contains the recommended parts of this section.
Input table:
``` text
```
Query:
``` sql
```
Result:
``` text
```
Follow up with any text to clarify the example.
**See Also**
- [link](#)