diff --git a/docs/en/query_language/clickhouse_local.md b/docs/en/query_language/clickhouse_local.md deleted file mode 100644 index d18cc2003203a1e1492b0b17b3646c69c5606fa1..0000000000000000000000000000000000000000 --- a/docs/en/query_language/clickhouse_local.md +++ /dev/null @@ -1,4 +0,0 @@ -# The clickhouse-local program - -The `clickhouse-local` program enables you to perform fast processing on local files that store tables, without having to deploy and configure clickhouse-server. - diff --git a/docs/en/utils/clickhouse-local.md b/docs/en/utils/clickhouse-local.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d18cc2003203a1e1492b0b17b3646c69c5606fa1 100644 --- a/docs/en/utils/clickhouse-local.md +++ b/docs/en/utils/clickhouse-local.md @@ -0,0 +1,4 @@ +# The clickhouse-local program + +The `clickhouse-local` program enables you to perform fast processing on local files that store tables, without having to deploy and configure clickhouse-server. + diff --git a/docs/mkdocs_en.yml b/docs/mkdocs_en.yml index c108052fdd271f4444687416d2c8926e558f9d26..1daf36ecfd824f27015467488bcc93680010eb04 100644 --- a/docs/mkdocs_en.yml +++ b/docs/mkdocs_en.yml @@ -12,6 +12,9 @@ edit_uri: 'edit/master/docs/en' extra_css: - assets/stylesheets/custom.css +markdown_extensions: + - codehilite + theme: name: null custom_dir: 'mkdocs-material-theme' @@ -34,9 +37,6 @@ extra: search: language: 'en' -markdown_extensions: - - codehilite - pages: - 'ClickHouse': 'index.md' @@ -59,7 +59,7 @@ pages: - 'Star Schema Benchmark': 'getting_started/example_datasets/star_schema.md' - 'Interfaces': - - 'Interfaces': 'interfaces/index.md' + - 'Introduction': 'interfaces/index.md' - 'Command-line client': 'interfaces/cli.md' - 'HTTP interface': 'interfaces/http_interface.md' - 'JDBC driver': 'interfaces/jdbc.md' @@ -71,7 +71,6 @@ pages: # - 'Query language': 'query_language/index.md' - 'Queries': 'query_language/queries.md' - 'Syntax': 'query_language/syntax.md' - - 'The clickhouse-local program': 'query_language/clickhouse_local.md' - 'Table engines': - 'Introduction': 'table_engines/index.md' @@ -234,9 +233,9 @@ pages: - 'Settings profiles': 'operations/settings/settings_profiles.md' - 'Utilites': - - 'Utilites': 'utils/index.md' + - 'Introduction': 'utils/index.md' - 'clickhouse-copier': 'utils/clickhouse-copier.md' - #- 'clickhouse-local' : 'utils/clickhouse-local.md' + - 'clickhouse-local': 'utils/clickhouse-local.md' - 'ClickHouse Development': # - 'ClickHouse Development': 'development/index.md' diff --git a/docs/mkdocs_ru.yml b/docs/mkdocs_ru.yml index 05d7e9d8eb80f9d2ba004d7cdedf12e00839f24d..743a29c6cf9c26461c53fde83d3313b23f6889c8 100644 --- a/docs/mkdocs_ru.yml +++ b/docs/mkdocs_ru.yml @@ -25,8 +25,6 @@ theme: primary: 'white' accent: 'white' font: false -# text: Roboto -# code: Roboto Mono logo: 'images/logo.svg' favicon: 'assets/images/favicon.ico' include_search_page: false @@ -39,8 +37,6 @@ extra: search: language: 'en, ru' - - pages: - 'ClickHouse': 'index.md' @@ -55,12 +51,12 @@ pages: - 'Начало работы': - 'Установка и запуск': 'getting_started/index.md' - 'Тестовые наборы данных': + - 'OnTime': 'getting_started/example_datasets/ontime.md' + - 'Данные о такси в Нью-Йорке': 'getting_started/example_datasets/nyc_taxi.md' - 'AMPLab Big Data Benchmark': 'getting_started/example_datasets/amplab_benchmark.md' + - 'WikiStat': 'getting_started/example_datasets/wikistat.md' - 'Терабайт логов кликов от Criteo': 'getting_started/example_datasets/criteo.md' - - 'Данные о такси в Нью-Йорке': 'getting_started/example_datasets/nyc_taxi.md' - - 'OnTime': 'getting_started/example_datasets/ontime.md' - 'Схема «Звезда»': 'getting_started/example_datasets/star_schema.md' - - 'WikiStat': 'getting_started/example_datasets/wikistat.md' - 'Интерфейсы': - 'Введение': 'interfaces/index.md' @@ -75,100 +71,99 @@ pages: # - 'Язык запросов': 'query_language/index.md' - 'Запросы': 'query_language/queries.md' - 'Синтаксис': 'query_language/syntax.md' - - 'Программа clickhouse-local': 'query_language/clickhouse_local.md' - 'Движки таблиц': - 'Введение': 'table_engines/index.md' + - 'TinyLog': 'table_engines/tinylog.md' + - 'Log': 'table_engines/log.md' + - 'Memory': 'table_engines/memory.md' + - 'MergeTree': 'table_engines/mergetree.md' + - 'Произвольный ключ партиционирования': 'table_engines/custom_partitioning_key.md' + - 'ReplacingMergeTree': 'table_engines/replacingmergetree.md' + - 'SummingMergeTree': 'table_engines/summingmergetree.md' - 'AggregatingMergeTree': 'table_engines/aggregatingmergetree.md' - - 'Buffer': 'table_engines/buffer.md' - 'CollapsingMergeTree': 'table_engines/collapsingmergetree.md' - - 'Произвольный ключ партиционирования': 'table_engines/custom_partitioning_key.md' - - 'Dictionary': 'table_engines/dictionary.md' - - 'Distributed': 'table_engines/distributed.md' - - 'Внешние данные для обработки запроса': 'table_engines/external_data.md' - - 'File(InputFormat)': 'table_engines/file.md' - 'GraphiteMergeTree': 'table_engines/graphitemergetree.md' - - 'Join': 'table_engines/join.md' - - 'Kafka': 'table_engines/kafka.md' - - 'Log': 'table_engines/log.md' - - 'MaterializedView': 'table_engines/materializedview.md' - - 'Memory': 'table_engines/memory.md' + - 'Data replication': 'table_engines/replication.md' + - 'Distributed': 'table_engines/distributed.md' + - 'Dictionary': 'table_engines/dictionary.md' - 'Merge': 'table_engines/merge.md' - - 'MergeTree': 'table_engines/mergetree.md' + - 'Buffer': 'table_engines/buffer.md' + - 'File': 'table_engines/file.md' - 'Null': 'table_engines/null.md' - - 'ReplacingMergeTree': 'table_engines/replacingmergetree.md' - - 'Репликация данных': 'table_engines/replication.md' - 'Set': 'table_engines/set.md' - - 'SummingMergeTree': 'table_engines/summingmergetree.md' - - 'TinyLog': 'table_engines/tinylog.md' + - 'Join': 'table_engines/join.md' - 'View': 'table_engines/view.md' + - 'MaterializedView': 'table_engines/materializedview.md' + - 'Kafka': 'table_engines/kafka.md' + - 'Внешние данные для обработки запроса': 'table_engines/external_data.md' - 'Системные таблицы': - 'Введение': 'system_tables/index.md' - - 'system.asynchronous_metrics': 'system_tables/system.asynchronous_metrics.md' - - 'system.clusters': 'system_tables/system.clusters.md' - - 'system.columns': 'system_tables/system.columns.md' - - 'system.databases': 'system_tables/system.databases.md' - - 'system.dictionaries': 'system_tables/system.dictionaries.md' - - 'system.events': 'system_tables/system.events.md' - - 'system.functions': 'system_tables/system.functions.md' - - 'system.merges': 'system_tables/system.merges.md' - - 'system.metrics': 'system_tables/system.metrics.md' + - 'system.one': 'system_tables/system.one.md' - 'system.numbers': 'system_tables/system.numbers.md' - 'system.numbers_mt': 'system_tables/system.numbers_mt.md' - - 'system.one': 'system_tables/system.one.md' + - 'system.databases': 'system_tables/system.databases.md' + - 'system.tables': 'system_tables/system.tables.md' + - 'system.columns': 'system_tables/system.columns.md' - 'system.parts': 'system_tables/system.parts.md' - 'system.processes': 'system_tables/system.processes.md' + - 'system.merges': 'system_tables/system.merges.md' + - 'system.events': 'system_tables/system.events.md' + - 'system.metrics': 'system_tables/system.metrics.md' + - 'system.asynchronous_metrics': 'system_tables/system.asynchronous_metrics.md' - 'system.replicas': 'system_tables/system.replicas.md' + - 'system.dictionaries': 'system_tables/system.dictionaries.md' + - 'system.clusters': 'system_tables/system.clusters.md' + - 'system.functions': 'system_tables/system.functions.md' - 'system.settings': 'system_tables/system.settings.md' - - 'system.tables': 'system_tables/system.tables.md' - 'system.zookeeper': 'system_tables/system.zookeeper.md' - 'Табличные функции': - - 'Общие сведения': 'table_functions/index.md' - - 'merge': 'table_functions/merge.md' + - 'Введение': 'table_functions/index.md' - 'remote': 'table_functions/remote.md' + - 'merge': 'table_functions/merge.md' - 'Форматы': - 'Введение': 'formats/index.md' - - 'CapnProto': 'formats/capnproto.md' + - 'TabSeparated': 'formats/tabseparated.md' + - 'TabSeparatedRaw': 'formats/tabseparatedraw.md' + - 'TabSeparatedWithNames': 'formats/tabseparatedwithnames.md' + - 'TabSeparatedWithNamesAndTypes': 'formats/tabseparatedwithnamesandtypes.md' - 'CSV': 'formats/csv.md' - 'CSVWithNames': 'formats/csvwithnames.md' + - 'Values': 'formats/values.md' + - 'Vertical': 'formats/vertical.md' - 'JSON': 'formats/json.md' - 'JSONCompact': 'formats/jsoncompact.md' - 'JSONEachRow': 'formats/jsoneachrow.md' - - 'Native': 'formats/native.md' - - 'Null': 'formats/null.md' + - 'TSKV': 'formats/tskv.md' - 'Pretty': 'formats/pretty.md' - 'PrettyCompact': 'formats/prettycompact.md' - 'PrettyCompactMonoBlock': 'formats/prettycompactmonoblock.md' - 'PrettyNoEscapes': 'formats/prettynoescapes.md' - 'PrettySpace': 'formats/prettyspace.md' - 'RowBinary': 'formats/rowbinary.md' - - 'TabSeparated': 'formats/tabseparated.md' - - 'TabSeparatedRaw': 'formats/tabseparatedraw.md' - - 'TabSeparatedWithNames': 'formats/tabseparatedwithnames.md' - - 'TabSeparatedWithNamesAndTypes': 'formats/tabseparatedwithnamesandtypes.md' - - 'TSKV': 'formats/tskv.md' - - 'Values': 'formats/values.md' - - 'Vertical': 'formats/vertical.md' + - 'Native': 'formats/native.md' + - 'Null': 'formats/null.md' - 'XML': 'formats/xml.md' + - 'CapnProto': 'formats/capnproto.md' - 'Типы данных': - 'Введение': 'data_types/index.md' - - 'Array(T)': 'data_types/array.md' + - 'UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64': 'data_types/int_uint.md' + - 'Float32, Float64': 'data_types/float.md' - 'Булевы значения': 'data_types/boolean.md' + - 'String': 'data_types/string.md' + - 'FixedString(N)': 'data_types/fixedstring.md' - 'Date': 'data_types/date.md' - 'DateTime': 'data_types/datetime.md' - 'Enum': 'data_types/enum.md' - - 'FixedString(N)': 'data_types/fixedstring.md' - - 'Float32, Float64': 'data_types/float.md' - - 'UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64': 'data_types/int_uint.md' - - 'String': 'data_types/string.md' + - 'Array(T)': 'data_types/array.md' + - 'AggregateFunction(name, types_of_arguments...)': 'data_types/nested_data_structures/aggregatefunction.md' - 'Tuple(T1, T2, ...)': 'data_types/tuple.md' - 'Вложенные структуры данных': # - 'Вложенные структуры данных': 'data_types/nested_data_structures/index.md' - - 'AggregateFunction(name, types_of_arguments...)': 'data_types/nested_data_structures/aggregatefunction.md' - 'Nested(Name1 Type1, Name2 Type2, ...)': 'data_types/nested_data_structures/nested.md' - 'Служебные типы данных': # - 'Служебные типы данных': 'data_types/special_data_types/index.md' @@ -180,31 +175,31 @@ pages: - 'Функции': - 'Общее описание': 'functions/index.md' - 'Арифметические функции': 'functions/arithmetic_functions.md' - - 'Функции по работе с массивами': 'functions/array_functions.md' - - 'Функция arrayJoin': 'functions/array_join.md' - - 'Битовые функции': 'functions/bit_functions.md' - 'Функции сравнения': 'functions/comparison_functions.md' - - 'Условные функции': 'functions/conditional_functions.md' - - 'Функции для работы с датами и временем': 'functions/date_time_functions.md' - - 'Функции кодирования': 'functions/encoding_functions.md' - - 'Функции для работы с внешними словарями': 'functions/ext_dict_functions.md' - - 'Функции хэширования': 'functions/hash_functions.md' - - 'Функции высшего порядка': 'functions/higher_order_functions.md' - - 'Функции для реализации оператора IN.': 'functions/in_functions.md' - - 'Функции для работы с IP-адресами': 'functions/ip_address_functions.md' - - 'Функции для работы с JSON.': 'functions/json_functions.md' - 'Логические функции': 'functions/logical_functions.md' + - 'Функции преобразования типов': 'functions/type_conversion_functions.md' + - 'Функции для работы с датами и временем': 'functions/date_time_functions.md' + - 'Функции для работы со строками': 'functions/string_functions.md' + - 'Функции поиска в строках': 'functions/string_search_functions.md' + - 'Функции поиска и замены в строках': 'functions/string_replace_functions.md' + - 'Условные функции': 'functions/conditional_functions.md' - 'Математические функции': 'functions/math_functions.md' - - 'Прочие функции': 'functions/other_functions.md' - - 'Функции генерации псевдослучайных чисел': 'functions/random_functions.md' - 'Функции округления': 'functions/rounding_functions.md' + - 'Функции по работе с массивами': 'functions/array_functions.md' - 'Функции разбиения и слияния строк и массивов': 'functions/splitting_merging_functions.md' - - 'Функции для работы со строками': 'functions/string_functions.md' - - 'Функции поиска и замены в строках': 'functions/string_replace_functions.md' - - 'Функции поиска в строках': 'functions/string_search_functions.md' - - 'Функции преобразования типов': 'functions/type_conversion_functions.md' + - 'Битовые функции': 'functions/bit_functions.md' + - 'Функции хэширования': 'functions/hash_functions.md' + - 'Функции генерации псевдослучайных чисел': 'functions/random_functions.md' + - 'Функции кодирования': 'functions/encoding_functions.md' - 'Функции для работы с URL': 'functions/url_functions.md' + - 'Функции для работы с IP-адресами': 'functions/ip_address_functions.md' + - 'Функции для работы с JSON.': 'functions/json_functions.md' + - 'Функции высшего порядка': 'functions/higher_order_functions.md' + - 'Прочие функции': 'functions/other_functions.md' + - 'Функции для работы с внешними словарями': 'functions/ext_dict_functions.md' - 'Функции для работы со словарями Яндекс.Метрики': 'functions/ym_dict_functions.md' + - 'Функции для реализации оператора IN.': 'functions/in_functions.md' + - 'Функция arrayJoin': 'functions/array_join.md' - 'Агрегатные функции': - 'Введение': 'agg_functions/index.md' @@ -239,9 +234,9 @@ pages: - 'Профили настроек': 'operations/settings/settings_profiles.md' - 'Утилиты': - - 'Утилиты': 'utils/index.md' + - 'Введение': 'utils/index.md' - 'clickhouse-copier': 'utils/clickhouse-copier.md' - #- 'clickhouse-local' : 'utils/clickhouse-local.md' + - 'clickhouse-local': 'utils/clickhouse-local.md' - 'ClickHouse Development': # - 'ClickHouse Development': 'development/index.md' diff --git a/docs/ru/query_language/clickhouse_local.md b/docs/ru/query_language/clickhouse_local.md deleted file mode 100644 index ee3f50dfeef24c80edb295a85ae0d7be7c732589..0000000000000000000000000000000000000000 --- a/docs/ru/query_language/clickhouse_local.md +++ /dev/null @@ -1,3 +0,0 @@ -# Программа clickhouse-local - -Программа `clickhouse-local` позволяет выполнять быструю обработку локальных файлов, хранящих таблицы, не прибегая к развертыванию и настройке clickhouse-server ... diff --git a/docs/ru/utils/clickhouse-copier.md b/docs/ru/utils/clickhouse-copier.md index 25d22f192226da6c8140b6fc439dd7ab9b269f78..8bcd58c23afc6d30bf7d0ade6fcb3701d607a615 100644 --- a/docs/ru/utils/clickhouse-copier.md +++ b/docs/ru/utils/clickhouse-copier.md @@ -1,23 +1,37 @@ -# clickhouse-copier util + -The util copies tables data from one cluster to new tables of other (possibly the same) cluster in distributed and fault-tolerant manner. +# clickhouse-copier -Configuration of copying tasks is set in special ZooKeeper node (called the `/description` node). -A ZooKeeper path to the description node is specified via `--task-path ` parameter. -So, node `/task/path/description` should contain special XML content describing copying tasks. +Копирует данные из таблиц одного кластера в таблицы другого (или этого же) кластера. -Simultaneously many `clickhouse-copier` processes located on any servers could execute the same task. -ZooKeeper node `/task/path/` is used by the processes to coordinate their work. -You must not add additional child nodes to `/task/path/`. +Можно запустить несколько `clickhouse-copier` для разных серверах для выполнения одного и того же задания. Для синхронизации между процессами используется ZooKeeper. -Currently you are responsible for manual launching of all `cluster-copier` processes. -You can launch as many processes as you want, whenever and wherever you want. -Each process try to select the nearest available shard of source cluster and copy some part of data (partition) from it to the whole -destination cluster (with resharding). -Therefore it makes sense to launch cluster-copier processes on the source cluster nodes to reduce the network usage. +После запуска, `clickhouse-copier`: +- Соединяется с ZooKeeper и получает: + - Задания на копирование. + - Состояние заданий на копирование. +- Выполняет задания. + Каждый запущенный процесс выбирает "ближайший" шард исходного кластера и копирует данные в кластер назначения, при необходимости перешардируя их. -Since the workers coordinate their work via ZooKeeper, in addition to `--task-path ` you have to specify ZooKeeper -cluster configuration via `--config-file ` parameter. Example of `zookeeper.xml`: +`clickhouse-copier` отслеживает изменения в ZooKeeper и применяет их "на лету". + +Для снижения сетевого трафика рекомендуем запускать `clickhouse-copier` на том же сервере, где находятся исходные данные. + +## Запуск clickhouse-copier + +Утилиту следует запускать вручную следующим образом: + +```bash +clickhouse-copier copier --daemon --config zookeeper.xml --task-path /task/path --base-dir /path/to/dir +``` + +Параметры запуска: +- `daemon` - запускает `clickhouse-copier` в режиме демона. +- `config` - путь к файлу `zookeeper.xml` с параметрами соединения с ZooKeeper. +- `task-path` - путь к ноде ZooKeeper. Нода используется для синхронизации между процессами `clickhouse-copier` и для хранения заданий. Задания хранятся в `$task-path/description`. +- `base-dir` - путь к логам и вспомогательным файлам. При запуске `clickhouse-copier` создает в `$base-dir` подкаталоги `clickhouse-copier_YYYYMMHHSS_`. Если параметр не указан, то каталоги будут создаваться в каталоге, где `clickhouse-copier` был запущен. + +## Формат zookeeper.xml ```xml @@ -30,11 +44,7 @@ cluster configuration via `--config-file ` parameter. Example of ``` -When you run `clickhouse-copier --config-file --task-path ` the process connects to ZooKeeper cluster, reads tasks config from `/task/path/description` and executes them. - -## Format of task config - -Here is an example of `/task/path/description` content: +## Конфигурация заданий на копирование ```xml @@ -103,7 +113,8 @@ Here is an example of `/task/path/description` content: specify partitions that should be copied in , they should be in quoted format like partition column of system.parts table. --> - ENGINE=ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/hits2', '{replica}') + + ENGINE=ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/hits2', '{replica}') PARTITION BY toMonday(date) ORDER BY (CounterID, EventDate) @@ -142,15 +153,4 @@ Here is an example of `/task/path/description` content: ``` -cluster-copier processes watch for `/task/path/description` node update. -So, if you modify the config settings or `max_workers` params, they will be updated. - -## Example - -```bash -clickhouse-copier copier --daemon --config /path/to/copier/zookeeper.xml --task-path /clickhouse-copier/cluster1_tables_hits --base-dir /path/to/copier_logs -``` - -`--base-dir /path/to/copier_logs` specifies where auxilary and log files of the copier process will be saved. -In this case it will create `/path/to/copier_logs/clickhouse-copier_YYYYMMHHSS_/` dir with log and status-files. -If it is not specified it will use current dir (`/clickhouse-copier_YYYYMMHHSS_/` if it is run as a `--daemon`). +`clickhouse-copier` отслеживает изменения `/task/path/description` и применяет их "на лету". Если вы поменяете, например, значение `max_workers`, то количество процессов, выполняющих задания, также изменится. diff --git a/docs/ru/utils/clickhouse-local.md b/docs/ru/utils/clickhouse-local.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d4b50c08320e3d2666854738c71f06ae510331d8 100644 --- a/docs/ru/utils/clickhouse-local.md +++ b/docs/ru/utils/clickhouse-local.md @@ -0,0 +1,5 @@ + + +#clickhouse-local + +Программа `clickhouse-local` позволяет выполнять быструю обработку локальных файлов, хранящих таблицы, не прибегая к развертыванию и настройке сервера ClickHouse. diff --git a/docs/ru/utils/index.md b/docs/ru/utils/index.md index 760fc0100c35f0c99a344ff6d8652821a3c51466..75bd574a72eced152970238c1c7aa77d8bffad1c 100644 --- a/docs/ru/utils/index.md +++ b/docs/ru/utils/index.md @@ -1,6 +1,4 @@ # Утилиты ClickHouse -Существует несколько утилит ClickHouse, которые представляют из себя отдельные исполняемые файлы: - -* `clickhouse-local` позволяет выполнять SQL-запросы над данными подобно тому, как это делает `awk` -* `clickhouse-copier` копирует (и перешардирует) неизменяемые данные с одного кластера на другой отказоустойчивым способом. +* [clickhouse-local](clickhouse-local.md#utils-clickhouse-local) - позволяет выполнять SQL-запросы над данными без установки сервера ClickHouse подобно тому, как это делает `awk`. +* [clickhouse-copier](clickhouse-copier.md#utils-clickhouse-copier) - копирует (и перешардирует) данные с одного кластера на другой.