Yandex Cloud
Поиск
Связаться с экспертомПопробовать бесплатно
  • Кейсы
  • Документация
  • Блог
  • Все сервисы
    • Cloud Interconnect
    • Cloud Backup
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Router
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Managed Service for YDB
    • SpeechKit
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • Container Registry
    • Managed Service for Prometheus®
    • Message Queue
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Cloud Apps
    • Yandex AI Studio
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Yandex Cloud Video
    • Stackland
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • DataSphere
    • Vision OCR
    • Translate
    • Cloud Registry
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Managed Service for GitLab
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Serverless Integrations
    • IoT Core
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
  • Статус работы сервисов
  • Marketplace
    • Доступны в регионе
    • Инфраструктура и сеть
    • Платформа данных
    • Искусственный интеллект
    • Безопасность
    • Инструменты DevOps
    • Бессерверные вычисления
    • Управление ресурсами
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Партнёрская программа
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Калькулятор цен
    • Тарифы
    • Акции и free tier
  • Кейсы
  • Документация
  • Блог
Создавайте контент и получайте гранты!Готовы написать своё руководство? Участвуйте в контент-программе и получайте гранты на работу с облачными сервисами!
Подробнее о программе
Проект Яндекса
© 2026 ТОО «Облачные Сервисы Казахстан»
Terraform в Yandex Cloud
  • Начало работы
  • Настройка аутентификации Terraform-провайдера Yandex Cloud
  • Библиотека решений
    • Обзор
    • История изменений (англ.)
          • mdb_clickhouse_cluster
          • mdb_clickhouse_cluster_iam_binding
          • mdb_clickhouse_cluster_v2
          • mdb_clickhouse_database
          • mdb_clickhouse_user

В этой статье:

  • Example usage
  • Arguments & Attributes Reference
  • Import
  1. Справочник Terraform
  2. Ресурсы (англ.)
  3. Managed Service for ClickHouse
  4. Resources
  5. mdb_clickhouse_cluster_v2

yandex_mdb_clickhouse_cluster_v2 (Resource)

Статья создана
Yandex Cloud
Обновлена 17 августа 2026 г.
Открыть в Markdown
  • Example usage
  • Arguments & Attributes Reference
  • Import

Manages a ClickHouse cluster within the Yandex Cloud. For more information, see the official documentation. How to connect to the DB. To connect, use port 9440. The port number is not configurable.

Example usageExample usage

//
// Create a new MDB Clickhouse Cluster.
//
resource "yandex_mdb_clickhouse_cluster_v2" "my_cluster" {
    name        = "test"
    environment = "PRESTABLE"
    network_id  = yandex_vpc_network.foo.id

    clickhouse = {
        resources = {
            resource_preset_id = "s2.micro"
            disk_type_id       = "network-ssd"
            disk_size          = 32
        }

        config = {
            log_level                       = "TRACE"
            max_connections                 = 100
            max_concurrent_queries          = 50
            keep_alive_timeout              = 3000
            uncompressed_cache_size         = 8589934592
            max_table_size_to_drop          = 53687091200
            max_partition_size_to_drop      = 53687091200
            timezone                        = "UTC"
            geobase_uri                     = ""
            query_log_retention_size        = 1073741824
            query_log_retention_time        = 2592000
            query_thread_log_enabled        = true
            query_thread_log_retention_size = 536870912
            query_thread_log_retention_time = 2592000
            part_log_retention_size         = 536870912
            part_log_retention_time         = 2592000
            metric_log_enabled              = true
            metric_log_retention_size       = 536870912
            metric_log_retention_time       = 2592000
            trace_log_enabled               = true
            trace_log_retention_size        = 536870912
            trace_log_retention_time        = 2592000
            text_log_enabled                = true
            text_log_retention_size         = 536870912
            text_log_retention_time         = 2592000
            text_log_level                  = "TRACE"
            background_pool_size            = 16
            background_schedule_pool_size   = 16

            merge_tree = {
                replicated_deduplication_window                           = 100
                replicated_deduplication_window_seconds                   = 604800
                parts_to_delay_insert                                     = 150
                parts_to_throw_insert                                     = 300
                max_replicated_merges_in_queue                            = 16
                number_of_free_entries_in_pool_to_lower_max_size_of_merge = 8
                max_bytes_to_merge_at_min_space_in_pool                   = 1048576
                max_bytes_to_merge_at_max_space_in_pool                   = 161061273600
            }

            kafka = {
                security_protocol = "SECURITY_PROTOCOL_PLAINTEXT"
                sasl_mechanism    = "SASL_MECHANISM_GSSAPI"
                sasl_username     = "user1"
                sasl_password     = "pass1"
            }

            rabbitmq = {
                username = "rabbit_user"
                password = "rabbit_pass"
            }

            compression = [
                {
                    method              = "LZ4"
                    min_part_size       = 1024
                    min_part_size_ratio = 0.5
                },
                {
                    method              = "ZSTD"
                    min_part_size       = 2048
                    min_part_size_ratio = 0.7
                },
            ]

            graphite_rollup = [
                {
                    name = "rollup1"
                    patterns = [{
                        regexp   = "abc"
                        function = "func1"
                        retention = [{
                            age       = 1000
                            precision = 3
                        }]
                    }]
                },
                {
                    name = "rollup2"
                    patterns = [{
                        function = "func2"
                        retention = [{
                            age       = 2000
                            precision = 5
                        }]
                    }]
                }
            ]
        }
    }

    hosts = {
        "clickhouse-host1" = {
            type       = "CLICKHOUSE"
            zone       = "ru-central1-a"
            shard_name = "shard1"
            subnet_id  = yandex_vpc_subnet.foo.id
        }
    }

    shards = {
        "shard1" = {}
    }

    format_schema {
        name = "test_schema"
        type = "FORMAT_SCHEMA_TYPE_CAPNPROTO"
        uri  = "https://storage.yandexcloud.net/ch-data/schema.proto"
    }

    service_account_id = "your_service_account_id"

    cloud_storage = {
        enabled = false
    }

    maintenance_window {
        type = "ANYTIME"
    }
}

resource "yandex_vpc_network" "foo" {}

resource "yandex_vpc_subnet" "foo" {
  zone           = "ru-central1-a"
  network_id     = yandex_vpc_network.foo.id
  v4_cidr_blocks = ["10.5.0.0/24"]
}
//
// Create a new MDB High Availability Clickhouse Cluster.
//
resource "yandex_mdb_clickhouse_cluster_v2" "my_cluster" {
  name        = "ha"
  environment = "PRESTABLE"
  network_id  = yandex_vpc_network.foo.id

  clickhouse = {
    resources = {
      resource_preset_id = "s2.micro"
      disk_type_id       = "network-ssd"
      disk_size          = 16
    }
  }

  zookeeper = {
    resources = {
      resource_preset_id = "s2.micro"
      disk_type_id       = "network-ssd"
      disk_size          = 10
    }
  }

  hosts = {
    "clickhouse-host1" = {
      type       = "CLICKHOUSE"
      zone       = "ru-central1-a"
      shard_name = "shard1"
      subnet_id  = yandex_vpc_subnet.foo.id
    }
    "clickhouse-host2" = {
      type       = "CLICKHOUSE"
      zone       = "ru-central1-b"
      shard_name = "shard1"
      subnet_id  = yandex_vpc_subnet.bar.id
    }
    "keeper-host1" = {
      type      = "KEEPER"
      zone      = "ru-central1-a"
      subnet_id = yandex_vpc_subnet.foo.id
    }
    "keeper-host2" = {
      type      = "KEEPER"
      zone      = "ru-central1-b"
      subnet_id = yandex_vpc_subnet.bar.id
    }
    "keeper-host3" = {
      type      = "KEEPER"
      zone      = "ru-central1-d"
      subnet_id = yandex_vpc_subnet.baz.id
    }
  }

  shards = {
    "shard1" = {}
  }

  cloud_storage = {
    enabled = false
  }

  maintenance_window {
    type = "ANYTIME"
  }
}

// Auxiliary resources
resource "yandex_vpc_network" "foo" {}

resource "yandex_vpc_subnet" "foo" {
  zone           = "ru-central1-a"
  network_id     = yandex_vpc_network.foo.id
  v4_cidr_blocks = ["10.1.0.0/24"]
}

resource "yandex_vpc_subnet" "bar" {
  zone           = "ru-central1-b"
  network_id     = yandex_vpc_network.foo.id
  v4_cidr_blocks = ["10.2.0.0/24"]
}

resource "yandex_vpc_subnet" "baz" {
  zone           = "ru-central1-d"
  network_id     = yandex_vpc_network.foo.id
  v4_cidr_blocks = ["10.3.0.0/24"]
}
//
// Create a new MDB Sharded Clickhouse Cluster.
//
resource "yandex_mdb_clickhouse_cluster_v2" "my_cluster" {
  name        = "sharded"
  environment = "PRODUCTION"
  network_id  = yandex_vpc_network.foo.id

  clickhouse = {
    resources = {
      resource_preset_id = "s2.micro"
      disk_type_id       = "network-ssd"
      disk_size          = 16
    }
  }

  zookeeper = {
    resources = {
      resource_preset_id = "s2.micro"
      disk_type_id       = "network-ssd"
      disk_size          = 10
    }
  }

  shards = {
    "shard1" = {
      weight = 110
    }
    "shard2" = {
      weight = 300
    }
  }

  hosts = {
    "clickhouse-shard1-host1" = {
      type       = "CLICKHOUSE"
      zone       = "ru-central1-a"
      subnet_id  = yandex_vpc_subnet.foo.id
      shard_name = "shard1"
    }
    "clickhouse-shard1-host2" = {
      type       = "CLICKHOUSE"
      zone       = "ru-central1-b"
      subnet_id  = yandex_vpc_subnet.bar.id
      shard_name = "shard1"
    }
    "clickhouse-shard2-host1" = {
      type       = "CLICKHOUSE"
      zone       = "ru-central1-b"
      subnet_id  = yandex_vpc_subnet.bar.id
      shard_name = "shard2"
    }
    "clickhouse-shard2-host2" = {
      type       = "CLICKHOUSE"
      zone       = "ru-central1-d"
      subnet_id  = yandex_vpc_subnet.baz.id
      shard_name = "shard2"
    }
  }

  shard_group {
    name        = "single_shard_group"
    description = "Cluster configuration that contain only shard1"
    shard_names = [
      "shard1",
    ]
  }

  cloud_storage = {
    enabled = false
  }

  maintenance_window {
    type = "ANYTIME"
  }
}

// Auxiliary resources
resource "yandex_vpc_network" "foo" {}

resource "yandex_vpc_subnet" "foo" {
  zone           = "ru-central1-a"
  network_id     = yandex_vpc_network.foo.id
  v4_cidr_blocks = ["10.1.0.0/24"]
}

resource "yandex_vpc_subnet" "bar" {
  zone           = "ru-central1-b"
  network_id     = yandex_vpc_network.foo.id
  v4_cidr_blocks = ["10.2.0.0/24"]
}

resource "yandex_vpc_subnet" "baz" {
  zone           = "ru-central1-d"
  network_id     = yandex_vpc_network.foo.id
  v4_cidr_blocks = ["10.3.0.0/24"]
}

Arguments & Attributes ReferenceArguments & Attributes Reference

  • access [Block]. Access policy to the ClickHouse cluster.
    • data_lens (Bool). Allow access for DataLens.
    • data_transfer (Bool). Allow access for DataTransfer.
    • metrika (Bool). Allow access for Yandex.Metrika.
    • serverless (Bool). Allow access for Serverless.
    • web_sql (Bool). Allow access for Web SQL.
    • yandex_query (Bool). Allow access for YandexQuery.
  • admin_password (String). A password used to authorize as user admin when sql_user_management enabled.
  • admin_password_wo (String). A password used to authorize as user admin when sql_user_management enabled. This attribute is write-only and is not stored in state. Requires admin_password_wo_version to trigger updates. Write-only arguments are supported in Terraform 1.11 and later.
  • admin_password_wo_version (Number). A version number for the write-only password. Increment this to trigger a password update.
  • allow_host_recreation (Bool). Allows or denies re-creation of hosts during cluster configuration changes that require it, such as a disk type change. Note: only data of replicated tables is preserved during host re-creation; data of non-replicated tables is lost.
  • backup_retain_period_days (Number). The period in days during which backups are stored.
  • backup_window_start [Block]. Time to start the daily backup, in the UTC timezone.
    • hours (Number). The hour at which backup will be started (UTC).
    • minutes (Number). The minute at which backup will be started (UTC).
  • clickhouse [Block]. Configuration of the ClickHouse subcluster.
    • config [Block]. Configuration of the ClickHouse subcluster.
      • access_control_improvements [Block]. Access control settings.
        • select_from_information_schema_requires_grant (Bool). Sets whether SELECT * FROM information_schema.<table> requires any grants and can be executed by any user. If set to true, then this query requires GRANT SELECT ON information_schema.<table>, just as for ordinary tables.
        • select_from_system_db_requires_grant (Bool). Sets whether SELECT * FROM system.<table> requires any grants and can be executed by any user. If set to true then this query requires GRANT SELECT ON system.<table> just as for non-system tables.
      • async_insert_threads (Number). Maximum number of threads to parse and insert data in background.
      • asynchronous_insert_log_enabled (Bool). Enable or disable asynchronous_insert_log system table.
      • asynchronous_insert_log_retention_size (Number). The maximum size that asynchronous_insert_log can grow to before old data will be removed.
      • asynchronous_insert_log_retention_time (Number). The maximum time that asynchronous_insert_log records will be retained before removal.
      • asynchronous_metric_log_enabled (Bool). Enable or disable asynchronous_metric_log system table.
      • asynchronous_metric_log_retention_size (Number). The maximum size that asynchronous_metric_log can grow to before old data will be removed.
      • asynchronous_metric_log_retention_time (Number). The maximum time that asynchronous_metric_log records will be retained before removal.
      • background_buffer_flush_schedule_pool_size (Number). The maximum number of threads that will be used for performing flush operations for Buffer-engine tables in the background.
      • background_common_pool_size (Number). The maximum number of threads that will be used for performing a variety of operations (mostly garbage collection) for MergeTree-engine tables in a background.
      • background_distributed_schedule_pool_size (Number). The maximum number of threads that will be used for executing distributed sends.
      • background_fetches_pool_size (Number). The maximum number of threads that will be used for fetching data parts from another replica for MergeTree-engine tables in a background.
      • background_merges_mutations_concurrency_ratio (Number). Sets a ratio between the number of threads and the number of background merges and mutations that can be executed concurrently.
      • background_message_broker_schedule_pool_size (Number). The maximum number of threads that will be used for executing background operations for message streaming.
      • background_move_pool_size (Number). The maximum number of threads that will be used for moving data parts to another disk or volume for MergeTree-engine tables in a background.
      • background_pool_size (Number). Sets the number of threads performing background merges and mutations for MergeTree-engine tables.
      • background_schedule_pool_size (Number). The maximum number of threads that will be used for constantly executing some lightweight periodic operations for replicated tables, Kafka streaming, and DNS cache updates.
      • backup_threads (Number). The maximum number of threads to execute BACKUP requests.
      • compression [Block]. Data compression configuration.
        • level (Number). Compression level for ZSTD method.
        • method (Required)(String). Compression method. Two methods are available: LZ4 and zstd.
        • min_part_size (Required)(Number). Min part size: Minimum size (in bytes) of a data part in a table. ClickHouse only applies the rule to tables with data parts greater than or equal to the Min part size value.
        • min_part_size_ratio (Required)(Number). Min part size ratio: Minimum table part size to total table size ratio. ClickHouse only applies the rule to tables in which this ratio is greater than or equal to the Min part size ratio value.
      • custom_macros [Block]. Custom ClickHouse macros.
        • name (Required)(String). Name of the macro.
        • value (Required)(String). Value of the macro.
      • default_database (String). Default database name.
      • dictionaries_lazy_load (Bool). Lazy loading of dictionaries. If true, then each dictionary is loaded on the first use.
      • error_log_enabled (Bool). Enables or disables error_log system table.
      • error_log_retention_size (Number). The maximum size that error_log can grow to before old data will be removed. If set to 0, automatic removal of error_log data based on size is disabled.
      • error_log_retention_time (Number). The maximum time that error_log records will be retained before removal. If set to 0, automatic removal of error_log data based on time is disabled.
      • geobase_enabled (Bool). Enable or disable geobase.
      • geobase_uri (String). Address of the archive with the user geobase in Object Storage.
      • graphite_rollup [Block]. Graphite rollup configuration.
        • name (Required)(String). Graphite rollup configuration name.
        • path_column_name (String). The name of the column storing the metric name (Graphite sensor). Default value: Path.
        • patterns [Block]. Set of thinning rules.
          • function (Required)(String). Aggregation function name.
          • regexp (String). Regular expression that the metric name must match.
          • retention [Block]. Retain parameters.
            • age (Required)(Number). Minimum data age in seconds.
            • precision (Required)(Number). Accuracy of determining the age of the data in seconds.
        • time_column_name (String). The name of the column storing the time of measuring the metric. Default value: Time.
        • value_column_name (String). The name of the column storing the value of the metric at the time set in time_column_name. Default value: Value.
        • version_column_name (String). The name of the column storing the version of the metric. Default value: Timestamp.
      • jdbc_bridge [Block]. JDBC bridge configuration.
        • host (Required)(String). Host of jdbc bridge.
        • port (Number). Port of jdbc bridge. Default value: 9019.
      • kafka [Block]. Kafka connection configuration.
        • auto_offset_reset (String). Action when no initial offset: 'smallest','earliest','largest','latest','error'.
        • batch_size (Number). Maximum size (in bytes) of all messages batched in one MessageSet, including protocol framing overhead.
        • debug (String). A comma-separated list of debug contexts to enable.
        • enable_ssl_certificate_verification (Bool). Enable verification of SSL certificates.
        • max_poll_interval_ms (Number). Maximum allowed time between calls to consume messages. If exceeded, consumer is considered failed.
        • message_max_bytes (Number). Maximum Kafka protocol request message size.
        • sasl_mechanism (String). SASL mechanism used in kafka authentication.
        • sasl_password (String). User password on kafka server.
        • sasl_username (String). Username on kafka server.
        • security_protocol (String). Security protocol used to connect to kafka server.
        • session_timeout_ms (Number). Client group session and failure detection timeout.
      • keep_alive_timeout (Number). The number of seconds that ClickHouse waits for incoming requests for HTTP protocol before closing the connection.
      • log_level (String). Logging level.
      • mark_cache_size (Number). Size of the cache for marks (index blocks). For details, see ClickHouse documentation.
      • max_build_vector_similarity_index_thread_pool_size (Number). Maximum number of threads for building vector similarity indexes. For details, see ClickHouse documentation.
      • max_concurrent_queries (Number). Limit on total number of concurrently executed queries.
      • max_connections (Number). Max server connections.
      • max_partition_size_to_drop (Number). Restriction on dropping partitions.
      • max_table_size_to_drop (Number). Restriction on deleting tables.
      • merge_tree [Block]. MergeTree engine configuration.
        • check_sample_column_is_correct (Bool). Enables the check at table creation that the sampling column type is correct. Default value: true.
        • cleanup_delay_period (Number). Minimum period to clean old queue logs, blocks hashes and parts.
        • deduplicate_merge_projection_mode (String). Determines the behavior of background merges for MergeTree tables with projections.
        • fsync_after_insert (Bool). Do fsync for every inserted part. Significantly decreases performance of inserts, not recommended to use with wide parts.
        • fsync_part_directory (Bool). Do fsync for part directory after all part operations (writes, renames, etc.).
        • inactive_parts_to_delay_insert (Number). If the number of inactive parts in a single partition in the table at least that many the inactive_parts_to_delay_insert value, an INSERT artificially slows down. It is useful when a server fails to clean up parts quickly enough.
        • inactive_parts_to_throw_insert (Number). If the number of inactive parts in a single partition more than the inactive_parts_to_throw_insert value, INSERT is interrupted with the Too many inactive parts (N). Parts cleaning are processing significantly slower than inserts exception.
        • lightweight_mutation_projection_mode (String). Determines the behavior of lightweight deletes for MergeTree tables with projections.
        • materialize_ttl_recalculate_only (Bool). Only recalculate ttl info when MATERIALIZE TTL.
        • max_avg_part_size_for_too_many_parts (Number). The too many parts check will be active only if the average part size is not larger than the specified threshold. This allows large tables if parts are successfully merged.
        • max_bytes_to_merge_at_max_space_in_pool (Number). The maximum total parts size (in bytes) to be merged into one part, if there are enough resources available. Roughly corresponds to the maximum possible part size created by an automatic background merge.
        • max_bytes_to_merge_at_min_space_in_pool (Number). Max bytes to merge at min space in pool: Maximum total size of a data part to merge when the number of free threads in the background pool is minimum.
        • max_cleanup_delay_period (Number). Maximum period to clean old queue logs, blocks hashes and parts. Default value: 300 seconds.
        • max_merge_selecting_sleep_ms (Number). Maximum sleep time for merge selecting. Default value: 60000 milliseconds (60 seconds).
        • max_number_of_merges_with_ttl_in_pool (Number). When there is more than specified number of merges with TTL entries in pool, do not assign new merge with TTL.
        • max_parts_in_total (Number). Maximum number of parts in all partitions.
        • max_replicated_merges_in_queue (Number). Max replicated merges in queue: Maximum number of merge tasks that can be in the ReplicatedMergeTree queue at the same time.
        • merge_max_block_size (Number). The number of rows that are read from the merged parts into memory. Default value: 8192.
        • merge_selecting_sleep_ms (Number). Sleep time for merge selecting when no part is selected. Lower values increase ZooKeeper requests in large clusters.
        • merge_with_recompression_ttl_timeout (Number). Minimum delay in seconds before repeating a merge with recompression TTL. Default value: 14400 seconds (4 hours).
        • merge_with_ttl_timeout (Number). Minimum delay in seconds before repeating a merge with delete TTL. Default value: 14400 seconds (4 hours).
        • min_age_to_force_merge_on_partition_only (Bool). Whether min_age_to_force_merge_seconds should be applied only on the entire partition and not on subset.
        • min_age_to_force_merge_seconds (Number). Merge parts if every part in the range is older than the value of min_age_to_force_merge_seconds.
        • min_bytes_for_wide_part (Number). Minimum number of bytes in a data part that can be stored in Wide format. You can set one, both or none of these settings.
        • min_compressed_bytes_to_fsync_after_fetch (Number). Minimal number of rows to do fsync for part after merge. 0 means disabled.
        • min_compressed_bytes_to_fsync_after_merge (Number). Minimal number of compressed bytes to do fsync for part after merge. 0 means disabled.
        • min_rows_for_wide_part (Number). Minimum number of rows in a data part that can be stored in Wide format. You can set one, both or none of these settings.
        • min_rows_to_fsync_after_merge (Number). Minimal number of rows to do fsync for part after merge. 0 means disabled.
        • number_of_free_entries_in_pool_to_execute_mutation (Number). When there is less than specified number of free entries in pool, do not execute part mutations. This is to leave free threads for regular merges and avoid Too many parts. Default value: 20.
        • number_of_free_entries_in_pool_to_lower_max_size_of_merge (Number). Number of free entries in pool to lower max size of merge: Threshold value of free entries in the pool. If the number of entries in the pool falls below this value, ClickHouse reduces the maximum size of a data part to merge. This helps handle small merges faster, rather than filling the pool with lengthy merges.
        • parts_to_delay_insert (Number). Parts to delay insert: Number of active data parts in a table, on exceeding which ClickHouse starts artificially reduce the rate of inserting data into the table
        • parts_to_throw_insert (Number). Parts to throw insert: Threshold value of active data parts in a table, on exceeding which ClickHouse throws the 'Too many parts ...' exception.
        • replicated_deduplication_window (Number). Replicated deduplication window: Number of recent hash blocks that ZooKeeper will store (the old ones will be deleted).
        • replicated_deduplication_window_seconds (Number). Replicated deduplication window seconds: Time during which ZooKeeper stores the hash blocks (the old ones will be deleted).
        • ttl_only_drop_parts (Bool). Enables zero-copy replication when a replica is located on a remote filesystem.
      • metric_log_enabled (Bool). Enable or disable metric_log system table.
      • metric_log_retention_size (Number). The maximum size that metric_log can grow to before old data will be removed.
      • metric_log_retention_time (Number). The maximum time that metric_log records will be retained before removal.
      • mysql_protocol (Bool). Enables or disables MySQL interface on ClickHouse server.
      • opentelemetry_span_log_enabled (Bool). Enable or disable opentelemetry_span_log system table.
      • opentelemetry_span_log_retention_size (Number). The maximum size that opentelemetry_span_log can grow to before old data will be removed.
      • opentelemetry_span_log_retention_time (Number). The maximum time that opentelemetry_span_log records will be retained before removal.
      • part_log_retention_size (Number). The maximum size that part_log can grow to before old data will be removed.
      • part_log_retention_time (Number). The maximum time that part_log records will be retained before removal.
      • processors_profile_log_enabled (Bool). Enables or disables processors_profile_log system table.
      • processors_profile_log_retention_size (Number). The maximum time that processors_profile_log records will be retained before removal. If set to 0, automatic removal of processors_profile_log data based on time is disabled.
      • processors_profile_log_retention_time (Number). Enables or disables error_log system table.
      • query_cache [Block]. Query cache configuration.
        • max_entries (Number). The maximum number of SELECT query results stored in the cache. Default value: 1024.
        • max_entry_size_in_bytes (Number). The maximum size in bytes SELECT query results may have to be saved in the cache. Default value: 1048576 (1 MiB).
        • max_entry_size_in_rows (Number). The maximum number of rows SELECT query results may have to be saved in the cache. Default value: 30000000 (30 mil).
        • max_size_in_bytes (Number). The maximum cache size in bytes. 0 means the query cache is disabled. Default value: 1073741824 (1 GiB).
      • query_log_retention_size (Number). The maximum size that query_log can grow to before old data will be removed.
      • query_log_retention_time (Number). The maximum time that query_log records will be retained before removal.
      • query_masking_rules [Block]. Query masking rules configuration.
        • name (String). Name for the rule.
        • regexp (Required)(String). RE2 compatible regular expression.
        • replace (String). Substitution string for sensitive data. Default value: six asterisks.
      • query_metric_log_enabled (Bool). Enables or disables query_metric_log system table.
      • query_metric_log_retention_size (Number). The maximum size that query_metric_log can grow to before old data will be removed. If set to 0, automatic removal of query_metric_log data based on size is disabled.
      • query_metric_log_retention_time (Number). The maximum time that query_metric_log records will be retained before removal. If set to 0, automatic removal of query_metric_log data based on time is disabled.
      • query_thread_log_enabled (Bool). Enable or disable query_thread_log system table.
      • query_thread_log_retention_size (Number). The maximum size that query_thread_log can grow to before old data will be removed.
      • query_thread_log_retention_time (Number). The maximum time that query_thread_log records will be retained before removal.
      • query_views_log_enabled (Bool). Enable or disable query_views_log system table.
      • query_views_log_retention_size (Number). The maximum size that query_views_log can grow to before old data will be removed.
      • query_views_log_retention_time (Number). The maximum time that query_views_log records will be retained before removal.
      • rabbitmq [Block]. RabbitMQ connection configuration.
        • password (String). RabbitMQ user password.
        • username (String). RabbitMQ username.
        • vhost (String). RabbitMQ vhost. Default: \.
      • restore_threads (Number). The maximum number of threads to execute RESTORE requests.
      • session_log_enabled (Bool). Enable or disable session_log system table.
      • session_log_retention_size (Number). The maximum size that session_log can grow to before old data will be removed.
      • session_log_retention_time (Number). The maximum time that session_log records will be retained before removal.
      • text_log_enabled (Bool). Enable or disable text_log system table.
      • text_log_level (String). Logging level for text_log system table.
      • text_log_retention_size (Number). The maximum size that text_log can grow to before old data will be removed.
      • text_log_retention_time (Number). The maximum time that text_log records will be retained before removal.
      • timezone (String). The server's time zone.
      • tls [Block]. TLS configuration for outgoing connections from ClickHouse (e.g. remote tables, dictionaries). Change of the settings is applied with restart.
        • trusted_certificates (List Of String). CA certificates in PEM format. Each element must contain a single self-signed CA certificate or a certificate chain ordered as leaf -> intermediates -> self-signed root. Change of the setting is applied with restart.
      • total_memory_profiler_step (Number). Whenever server memory usage becomes larger than every next step in number of bytes the memory profiler will collect the allocating stack trace.
      • total_memory_tracker_sample_probability (Number). Allows to collect random allocations and de-allocations and writes them in the system.trace_log system table with trace_type equal to a MemorySample with the specified probability.
      • trace_log_enabled (Bool). Enable or disable trace_log system table.
      • trace_log_retention_size (Number). The maximum size that trace_log can grow to before old data will be removed.
      • trace_log_retention_time (Number). The maximum time that trace_log records will be retained before removal.
      • uncompressed_cache_size (Number). Cache size (in bytes) for uncompressed data used by table engines from the MergeTree family. Zero means disabled.
      • vector_similarity_index_cache_max_entries (Number). Maximum number of entries in the vector similarity index cache. For details, see ClickHouse documentation.
      • vector_similarity_index_cache_size (Number). Maximum size of the cache for vector similarity index. For details, see ClickHouse documentation.
      • zookeeper_log_enabled (Bool). Enable or disable zookeeper_log system table.
      • zookeeper_log_retention_size (Number). The maximum size that zookeeper_log can grow to before old data will be removed.
      • zookeeper_log_retention_time (Number). The maximum time that zookeeper_log records will be retained before removal.
    • default_user_settings [Block]. Settings that are applied to all users of the ClickHouse cluster by default. They are overridden by the settings of a particular user. For more information, see the official documentation.
      • add_http_cors_header (Bool). Include CORS headers in HTTP response.
      • allow_ddl (Bool). Allows or denies DDL queries.
      • allow_introspection_functions (Bool). Enables or disables introspection functions for query profiling.
      • allow_suspicious_low_cardinality_types (Bool). Allows specifying LowCardinality modifier for types of small fixed size (8 or less) in CREATE TABLE statements. Enabling this may increase merge times and memory consumption.
      • any_join_distinct_right_table_keys (Bool). Enables legacy ClickHouse server behaviour in ANY INNER|LEFT JOIN operations.
      • async_insert (Bool). Enables asynchronous inserts. Disabled by default.
      • async_insert_busy_timeout (Number). The maximum timeout in milliseconds since the first INSERT query before inserting collected data. If the parameter is set to 0, the timeout is disabled. Default value: 200.
      • async_insert_max_data_size (Number). The maximum size of the unparsed data in bytes collected per query before being inserted. If the parameter is set to 0, asynchronous insertions are disabled. Default value: 100000.
      • async_insert_stale_timeout (Number). The maximum timeout in milliseconds since the last INSERT query before dumping collected data. If enabled, the settings prolongs the async_insert_busy_timeout with every INSERT query as long as async_insert_max_data_size is not exceeded.
      • async_insert_threads (Number). The maximum number of threads for background data parsing and insertion. If the parameter is set to 0, asynchronous insertions are disabled. Default value: 16.
      • async_insert_use_adaptive_busy_timeout (Bool). If it is set to true, use adaptive busy timeout for asynchronous inserts.
      • cancel_http_readonly_queries_on_client_close (Bool). Cancels HTTP read-only queries (e.g. SELECT) when a client closes the connection without waiting for the response. Default value: false.
      • compile_expressions (Bool). Enable or disable compilation of some scalar functions and operators to native code.
      • connect_timeout (Number). Connection timeout in milliseconds.
      • connect_timeout_with_failover (Number). The timeout in milliseconds for connecting to a remote server for a Distributed table engine. Applies only if the cluster uses sharding and replication. If unsuccessful, several attempts are made to connect to various replicas.
      • count_distinct_implementation (String). Specifies which of the uniq* functions should be used to perform the COUNT(DISTINCT …) construction.
      • data_type_default_nullable (Bool). Allows data types without explicit modifiers NULL or NOT NULL in column definition will be Nullable.
      • date_time_input_format (String). Allows choosing a parser of the text representation of date and time, one of: best_effort, basic, best_effort_us. Default value: basic. Cloud default value: best_effort.
      • date_time_output_format (String). Allows choosing different output formats of the text representation of date and time, one of: simple, iso, unix_timestamp. Default value: simple.
      • deduplicate_blocks_in_dependent_materialized_views (Bool). Enables or disables the deduplication check for materialized views that receive data from Replicated* tables.
      • distinct_overflow_mode (String). Sets behaviour on overflow when using DISTINCT.
      • distributed_aggregation_memory_efficient (Bool). Enables of disables memory saving mode when doing distributed aggregation.
      • distributed_ddl_output_mode (String). Determines the format of distributed DDL query result.
      • distributed_ddl_task_timeout (Number). Timeout for DDL queries, in milliseconds.
      • distributed_product_mode (String). Determine the behavior of distributed subqueries.
      • do_not_merge_across_partitions_select_final (Bool). Enable or disable independent processing of partitions for SELECT queries with FINAL.
      • empty_result_for_aggregation_by_empty_set (Bool). Allows to retunr empty result.
      • enable_analyzer (Bool). Enable new query analyzer.
      • enable_http_compression (Bool). Enables or disables data compression in the response to an HTTP request.
      • enable_reads_from_query_cache (Bool). If turned on, results of SELECT queries are retrieved from the query cache.
      • enable_writes_to_query_cache (Bool). If turned on, results of SELECT queries are stored in the query cache.
      • fallback_to_stale_replicas_for_distributed_queries (Bool). Enables or disables query forcing to a stale replica in case the actual data is unavailable. If enabled, ClickHouse will choose the most up-to-date replica and force the query to use the data in this replica.
      • flatten_nested (Bool). Sets the data format of a nested columns.
      • force_index_by_date (Bool). Disable query execution if the index cannot be used by date.
      • force_primary_key (Bool). Disable query execution if indexing by the primary key is not possible.
      • format_avro_schema_registry_url (String). Avro schema registry URL.
      • format_regexp (String). Regular expression (for Regexp format).
      • format_regexp_skip_unmatched (Bool). Skip lines unmatched by regular expression.
      • group_by_overflow_mode (String). Sets behaviour on overflow while GROUP BY operation.
      • group_by_two_level_threshold (Number). Sets the threshold of the number of keys, after that the two-level aggregation should be used.
      • group_by_two_level_threshold_bytes (Number). Sets the threshold of the number of bytes, after that the two-level aggregation should be used.
      • hedged_connection_timeout_ms (Number). Connection timeout for establishing connection with replica for Hedged requests. Default value: 50 milliseconds.
      • http_connection_timeout (Number). Timeout for HTTP connection in milliseconds.
      • http_headers_progress_interval (Number). Sets minimal interval between notifications about request process in HTTP header X-ClickHouse-Progress.
      • http_max_field_name_size (Number). Maximum length of field name in HTTP header.
      • http_max_field_value_size (Number). Maximum length of field value in HTTP header.
      • http_receive_timeout (Number). Timeout for HTTP connection in milliseconds.
      • http_send_timeout (Number). Timeout for HTTP connection in milliseconds.
      • idle_connection_timeout (Number). Timeout to close idle TCP connections after specified number of seconds. Default value: 3600 seconds.
      • ignore_materialized_views_with_dropped_target_table (Bool). Ignore materialized views with dropped target table during pushing to views.
      • input_format_defaults_for_omitted_fields (Bool). When performing INSERT queries, replace omitted input column values with default values of the respective columns.
      • input_format_import_nested_json (Bool). Enables or disables the insertion of JSON data with nested objects.
      • input_format_null_as_default (Bool). Enables or disables the initialization of NULL fields with default values, if data type of these fields is not nullable.
      • input_format_parallel_parsing (Bool). Enables or disables order-preserving parallel parsing of data formats. Supported only for TSV, TKSV, CSV and JSONEachRow formats.
      • input_format_values_interpret_expressions (Bool). Enables or disables the full SQL parser if the fast stream parser can’t parse the data.
      • input_format_with_names_use_header (Bool). Enables or disables checking the column order when inserting data.
      • insert_keeper_max_retries (Number). The setting sets the maximum number of retries for ClickHouse Keeper (or ZooKeeper) requests during insert into replicated MergeTree. Only Keeper requests which failed due to network error, Keeper session timeout, or request timeout are considered for retries.
      • insert_null_as_default (Bool). Enables the insertion of default values instead of NULL into columns with not nullable data type. Default value: true.
      • insert_quorum (Number). Enables the quorum writes.
      • insert_quorum_parallel (Bool). Enables or disables parallelism for quorum INSERT queries.
      • insert_quorum_timeout (Number). Quorum write timeout in milliseconds.
      • join_algorithm (Set Of String). Specifies which JOIN algorithm to use.
      • join_overflow_mode (String). Sets behaviour on overflow in JOIN.
      • join_use_nulls (Bool). Sets the type of JOIN behaviour. When merging tables, empty cells may appear. ClickHouse fills them differently based on this setting.
      • joined_subquery_requires_alias (Bool). Require aliases for subselects and table functions in FROM that more than one table is present.
      • load_balancing (String). Specifies the algorithm of replicas selection that is used for distributed query processing, one of: random, nearest_hostname, in_order, first_or_random, round_robin. Default value: random.
      • local_filesystem_read_method (String). Method of reading data from local filesystem. Possible values:
  • 'read' - abort query execution, return an error.
  • 'pread' - abort query execution, return an error.
  • 'pread_threadpool' - stop query execution, return partial result.
    If the parameter is set to 0 (default), no hops is allowed.
    • log_processors_profiles (Bool). Enabled or disable logging of processors level profiling data to the the system.processors_profile_log table.
    • log_queries_probability (Number). Log queries with the specified probability.
    • log_query_threads (Bool). Setting up query threads logging. Query threads log into the system.query_thread_log table. This setting has effect only when log_queries is true. Queries’ threads run by ClickHouse with this setup are logged according to the rules in the query_thread_log server configuration parameter. Default value: true.
    • log_query_views (Bool). Enables or disables query views logging to the the system.query_views_log table.
    • low_cardinality_allow_in_native_format (Bool). Allows or restricts using the LowCardinality data type with the Native format.
    • max_ast_depth (Number). Limits the maximum depth of query syntax tree.
    • max_ast_elements (Number). Limits the maximum size of query syntax tree in number of nodes.
    • max_block_size (Number). A recommendation for what size of the block (in a count of rows) to load from tables.
    • max_bytes_before_external_group_by (Number). Limit in bytes for using memoru for GROUP BY before using swap on disk.
    • max_bytes_before_external_sort (Number). This setting is equivalent of the max_bytes_before_external_group_by setting, except for it is for sort operation (ORDER BY), not aggregation.
    • max_bytes_in_distinct (Number). Limits the maximum size of a hash table in bytes (uncompressed data) when using DISTINCT.
    • max_bytes_in_join (Number). Limit on maximum size of the hash table for JOIN, in bytes.
    • max_bytes_in_set (Number). Limit on the number of bytes in the set resulting from the execution of the IN section.
    • max_bytes_to_read (Number). Limits the maximum number of bytes (uncompressed data) that can be read from a table when running a query.
    • max_bytes_to_sort (Number). Limits the maximum number of bytes (uncompressed data) that can be read from a table for sorting.
    • max_bytes_to_transfer (Number). Limits the maximum number of bytes (uncompressed data) that can be passed to a remote server or saved in a temporary table when using GLOBAL IN.
    • max_columns_to_read (Number). Limits the maximum number of columns that can be read from a table in a single query.
    • max_concurrent_queries_for_user (Number). The maximum number of concurrent requests per user. Default value: 0 (no limit).
    • max_execution_time (Number). Limits the maximum query execution time in milliseconds.
    • max_expanded_ast_elements (Number). Limits the maximum size of query syntax tree in number of nodes after expansion of aliases and the asterisk values.
    • max_final_threads (Number). Sets the maximum number of parallel threads for the SELECT query data read phase with the FINAL modifier.
    • max_http_get_redirects (Number). Limits the maximum number of HTTP GET redirect hops for URL-engine tables.
    • max_insert_block_size (Number). The size of blocks (in a count of rows) to form for insertion into a table.
    • max_insert_threads (Number). The maximum number of threads to execute the INSERT SELECT query. Default value: 0.
    • max_memory_usage (Number). Maximum memory usage for processing all concurrently running queries for the user. Zero means unlimited.
    • max_memory_usage_for_user (Number). Maximum memory usage for processing all concurrently running queries for the user. Zero means unlimited.
    • max_network_bandwidth (Number). Limits the speed of the data exchange over the network in bytes per second. This setting applies to every query.
    • max_network_bandwidth_for_user (Number). Limits the speed of the data exchange over the network in bytes per second. This setting applies to all concurrently running queries performed by a single user.
    • max_parser_depth (Number). Limits maximum recursion depth in the recursive descent parser. Allows controlling the stack size.
    • max_partitions_per_insert_block (Number). Limits the maximum number of partitions in a single inserted block.
    • max_query_size (Number). The maximum part of a query that can be taken to RAM for parsing with the SQL parser.
    • max_read_buffer_size (Number). The maximum size of the buffer to read from the filesystem.
    • max_replica_delay_for_distributed_queries (Number). Max replica delay in milliseconds. If a replica lags more than the set value,this replica is not used and becomes a stale one.
    • max_result_bytes (Number). Limits the number of bytes in the result.
    • max_result_rows (Number). Limits the number of rows in the result.
    • max_rows_in_distinct (Number). Limits the maximum number of different rows when using DISTINCT.
    • max_rows_in_join (Number). Limit on maximum size of the hash table for JOIN, in rows.
    • max_rows_in_set (Number). Limit on the number of rows in the set resulting from the execution of the IN section.
    • max_rows_to_group_by (Number). Limits the maximum number of unique keys received from aggregation function.
    • max_rows_to_read (Number). Limits the maximum number of rows that can be read from a table when running a query.
    • max_rows_to_sort (Number). Limits the maximum number of rows that can be read from a table for sorting.
    • max_rows_to_transfer (Number). Limits the maximum number of rows that can be passed to a remote server or saved in a temporary table when using GLOBAL IN.
    • max_temporary_columns (Number). Limits the maximum number of temporary columns that must be kept in RAM at the same time when running a query, including constant columns.
    • max_temporary_data_on_disk_size_for_query (Number). The maximum amount of data consumed by temporary files on disk in bytes for all concurrently running queries. Zero means unlimited.
    • max_temporary_data_on_disk_size_for_user (Number). The maximum amount of data consumed by temporary files on disk in bytes for all concurrently running user queries. Zero means unlimited.
    • max_temporary_non_const_columns (Number). Limits the maximum number of temporary columns that must be kept in RAM at the same time when running a query, excluding constant columns.
    • max_threads (Number). The maximum number of query processing threads, excluding threads for retrieving data from remote servers.
    • memory_overcommit_ratio_denominator (Number). It represents soft memory limit in case when hard limit is reached on user level. This value is used to compute overcommit ratio for the query. Zero means skip the query.
    • memory_overcommit_ratio_denominator_for_user (Number). It represents soft memory limit in case when hard limit is reached on global level. This value is used to compute overcommit ratio for the query. Zero means skip the query.
    • memory_profiler_sample_probability (Number). Collect random allocations and deallocations and write them into system.trace_log with 'MemorySample' trace_type. The probability is for every alloc/free regardless to the size of the allocation. Possible values: from 0 to 1. Default: 0.
    • memory_profiler_step (Number). Memory profiler step (in bytes). If the next query step requires more memory than this parameter specifies, the memory profiler collects the allocating stack trace. Values lower than a few megabytes slow down query processing. Default value: 4194304 (4 MB). Zero means disabled memory profiler.
    • memory_usage_overcommit_max_wait_microseconds (Number). Maximum time thread will wait for memory to be freed in the case of memory overcommit on a user level. If the timeout is reached and memory is not freed, an exception is thrown.
    • merge_tree_max_bytes_to_use_cache (Number). If ClickHouse should read more than merge_tree_max_bytes_to_use_cache bytes in one query, it doesn’t use the cache of uncompressed blocks.
    • merge_tree_max_rows_to_use_cache (Number). If ClickHouse should read more than merge_tree_max_rows_to_use_cache rows in one query, it doesn’t use the cache of uncompressed blocks.
    • merge_tree_min_bytes_for_concurrent_read (Number). If the number of bytes to read from one file of a MergeTree-engine table exceeds merge_tree_min_bytes_for_concurrent_read, then ClickHouse tries to concurrently read from this file in several threads.
    • merge_tree_min_rows_for_concurrent_read (Number). If the number of rows to be read from a file of a MergeTree table exceeds merge_tree_min_rows_for_concurrent_read then ClickHouse tries to perform a concurrent reading from this file on several threads.
    • min_bytes_to_use_direct_io (Number). The minimum data volume required for using direct I/O access to the storage disk.
    • min_count_to_compile_expression (Number). Minimum count of executing same expression before it is get compiled.
    • min_execution_speed (Number). Minimal execution speed in rows per second.
    • min_execution_speed_bytes (Number). Minimal execution speed in bytes per second.
    • min_insert_block_size_bytes (Number). Sets the minimum number of bytes in the block which can be inserted into a table by an INSERT query.
    • min_insert_block_size_rows (Number). Sets the minimum number of rows in the block which can be inserted into a table by an INSERT query.
    • output_format_json_quote_64bit_integers (Bool). If the value is true, integers appear in quotes when using JSON* Int64 and UInt64 formats (for compatibility with most JavaScript implementations); otherwise, integers are output without the quotes.
    • output_format_json_quote_denormals (Bool). Enables +nan, -nan, +inf, -inf outputs in JSON output format.
    • prefer_localhost_replica (Bool). Enables/disables preferable using the localhost replica when processing distributed queries. Default value: true.
    • priority (Number). Priority of the query.
    • query_cache_max_entries (Number). The maximum number of query results the current user may store in the query cache. 0 means unlimited.
    • query_cache_max_size_in_bytes (Number). The maximum amount of memory (in bytes) the current user may allocate in the query cache. 0 means unlimited.
    • query_cache_min_query_duration (Number). Minimum duration in milliseconds a query needs to run for its result to be stored in the query cache.
    • query_cache_min_query_runs (Number). Minimum number of times a SELECT query must run before its result is stored in the query cache.
    • query_cache_nondeterministic_function_handling (String). Controls how the query cache handles SELECT queries with non-deterministic functions like rand() or now().
    • query_cache_share_between_users (Bool). If turned on, the result of SELECT queries cached in the query cache can be read by other users. It is not recommended to enable this setting due to security reasons.
    • query_cache_system_table_handling (String). Controls how the query cache handles SELECT queries against system tables.
    • query_cache_tag (String). A string which acts as a label for query cache entries. The same queries with different tags are considered different by the query cache.
    • query_cache_ttl (Number). After this time in seconds entries in the query cache become stale.
    • quota_mode (String). Quota accounting mode.
    • read_overflow_mode (String). Sets behaviour on overflow while read. Possible values: * throw - abort query execution, return an error. * break - stop query execution, return partial result.
    • readonly (Number). Restricts permissions for non-DDL queries.
    • receive_timeout (Number). Receive timeout in milliseconds.
    • remote_filesystem_read_method (String). Method of reading data from remote filesystem, one of: read, threadpool.
    • replication_alter_partitions_sync (Number). Wait mode for asynchronous actions in ALTER queries on replicated tables.
    • result_overflow_mode (String). Sets behaviour on overflow in result.
    • s3_use_adaptive_timeouts (Bool). Enables or disables adaptive timeouts for S3 requests.
    • select_sequential_consistency (Bool). Determines the behavior of SELECT queries from replicated tables. If enabled, ClickHouse will terminate a query with error message in case the replica does not have a chunk written with the quorum and will not read the parts that have not yet been written with the quorum.
    • send_progress_in_http_headers (Bool). Enables or disables X-ClickHouse-Progress HTTP response headers in clickhouse-server responses.
    • send_timeout (Number). Send timeout in milliseconds.
    • set_overflow_mode (String). Sets behaviour on overflow in the set resulting.
    • skip_unavailable_shards (Bool). Enables or disables silent skipping of unavailable shards
    • sort_overflow_mode (String). Sets behaviour on overflow while sort.
    • timeout_before_checking_execution_speed (Number). Timeout (in seconds) between checks of execution speed. It is checked that execution speed is not less that specified in min_execution_speed parameter. Must be at least 1000.
    • timeout_overflow_mode (String). Sets behaviour on overflow.
    • transfer_overflow_mode (String). Sets behaviour on overflow.
    • transform_null_in (Bool). Enables equality of NULL values for IN operator.
    • use_hedged_requests (Bool). Enables hedged requests logic for remote queries. It allows to establish many connections with different replicas for query. New connection is enabled in case existent connection(s) with replica(s) were not established within hedged_connection_timeout or no data was received within receive_data_timeout. Query uses the first connection which send non empty progress packet (or data packet, if allow_changing_replica_until_first_data_packet); other connections are cancelled. Queries with max_parallel_replicas > 1 are supported. Default value: true.
    • use_query_cache (Bool). If turned on, SELECT queries may utilize the query cache.
    • use_uncompressed_cache (Bool). Whether to use a cache of uncompressed blocks.
    • wait_for_async_insert (Bool). Enables waiting for processing of asynchronous insertion. If enabled, server returns OK only after the data is inserted.
    • wait_for_async_insert_timeout (Number). The timeout (in seconds) for waiting for processing of asynchronous insertion. Value must be at least 1000 (1 second).
    • disk_size_autoscaling [Block]. Cluster disk size autoscaling settings.
      • disk_size_limit (Required)(Number). The overall maximum for disk size that limit all autoscaling iterations. See the documentation for details.
      • emergency_usage_threshold (Number). Threshold of storage usage (in percent) that triggers immediate automatic scaling of the storage. Zero value means disabled threshold.
      • planned_usage_threshold (Number). Threshold of storage usage (in percent) that triggers automatic scaling of the storage during the maintenance window. Zero value means disabled threshold.
    • resources [Block]. Resources allocated to hosts.
      • disk_size (Number). Volume of the storage available to a host, in gigabytes.
      • disk_type_id (String). Type of the storage of hosts. For more information see the official documentation.
      • resource_preset_id (String). The ID of the preset for computational resources available to a host (CPU, memory etc.). For more information, see the official documentation.
  • cloud_storage [Block]. Cloud Storage settings.
    • data_cache_enabled (Bool). Enables temporary storage in the cluster repository of data requested from the object repository.
    • data_cache_max_size (Number). Defines the maximum amount of memory (in bytes) allocated in the cluster storage for temporary storage of data requested from the object storage.
    • enabled (Required)(Bool). Whether to use Yandex Object Storage for storing ClickHouse data. Can be either true or false.
    • move_factor (Number). Sets the minimum free space ratio in the cluster storage. If the free space is lower than this value, the data is transferred to Yandex Object Storage. Acceptable values are 0 to 1, inclusive.
    • prefer_not_to_merge (Bool). Disables merging of data parts in Yandex Object Storage.
  • cluster_id (Read-Only) (String). ID of the ClickHouse cluster. This ID is assigned by MDB at creation time.
  • copy_schema_on_new_hosts (Bool). Whether to copy schema on new ClickHouse hosts.
  • created_at (Read-Only) (String). The creation timestamp of the resource.
  • deletion_protection (Bool). The true value means that resource is protected from accidental deletion.
  • description (String). The resource description.
  • disk_encryption_key_id (String). ID of the KMS key for cluster disk encryption.
  • embedded_keeper (Bool). Whether to use ClickHouse Keeper as a coordination system.
  • environment (Required)(String). Deployment environment of the ClickHouse cluster.
  • external_dictionary [Block]. External dictionaries configuration. The map key is the dictionary name.
    • layout [Block]. Layout of the external dictionary.
      • access_to_key_from_attributes (Bool). Allows to retrieve key attribute using dictGetString function.
      • allow_read_expired_keys (Bool). Allow reading expired keys.
      • block_size (Number). Block size for SSD_CACHE and COMPLEX_KEY_SSD_CACHE layout types.
      • file_size (Number). Maximum cache file size in bytes for SSD_CACHE and COMPLEX_KEY_SSD_CACHE layout types.
      • initial_array_size (Number). Initial dictionary key size for FLAT layout.
      • max_array_size (Number). Maximum dictionary key size for FLAT layout.
      • max_threads_for_updates (Number). Max threads for cache dictionary update.
      • max_update_queue_size (Number). Max size of update queue.
      • query_wait_timeout_milliseconds (Number). Max wait timeout in milliseconds for update task to complete.
      • read_buffer_size (Number). RAM buffer size for reading from SSD in bytes for SSD_CACHE and COMPLEX_KEY_SSD_CACHE layout types.
      • size_in_cells (Number). Number of cells in the cache or initial array size.
      • type (Required)(String). Layout type.
      • update_queue_push_timeout_milliseconds (Number). Max timeout in milliseconds for push update task into queue.
      • write_buffer_size (Number). RAM buffer size for writing to SSD in bytes for SSD_CACHE and COMPLEX_KEY_SSD_CACHE layout types.
    • lifetime [Block]. Lifetime of the dictionary data.
      • fixed_lifetime (Number). Fixed reload interval in seconds.
      • range [Block]. Random reload interval in seconds.
        • max (Required)(Number). Maximum reload interval.
        • min (Required)(Number). Minimum reload interval.
    • source [Block]. Source of the external dictionary data.
      • clickhouse_source [Block]. ClickHouse source for the external dictionary.
        • db (Required)(String). ClickHouse database name.
        • host (String). ClickHouse host. Defaults to localhost if not specified.
        • password (String). ClickHouse password.
        • port (Number). ClickHouse port. Defaults to 8123 if not specified.
        • secure (Bool). Use TLS for the connection.
        • table (Required)(String). ClickHouse table name.
        • user (Required)(String). ClickHouse user.
        • where (String). Selection criteria (WHERE clause).
      • http_source [Block]. HTTP source for the external dictionary.
        • format (Required)(String). Data format (CSV, TSV, etc.).
        • headers [Block]. HTTP headers.
          • name (Required)(String). Header name.
          • value (Required)(String). Header value.
        • url (Required)(String). URL of the HTTP source.
      • mongodb_source [Block]. MongoDB source for the external dictionary.
        • collection (Required)(String). MongoDB collection name.
        • db (Required)(String). MongoDB database name.
        • host (Required)(String). MongoDB host.
        • options (String). MongoDB connection options (e.g. authSource=admin).
        • password (String). MongoDB password.
        • port (Number). MongoDB port. Defaults to 27017 if not specified.
        • user (Required)(String). MongoDB user.
      • mysql_source [Block]. MySQL source for the external dictionary.
        • close_connection (Bool). Close connection after each query.
        • db (Required)(String). MySQL database name.
        • invalidate_query (String). Query to check if the dictionary data has changed.
        • password (String). Default password for replicas.
        • port (Number). Default port for replicas.
        • replicas [Block]. MySQL replicas.
          • host (Required)(String). Replica host.
          • password (String). Replica password.
          • port (Number). Replica port.
          • priority (Required)(Number). Replica priority.
          • user (String). Replica user.
        • share_connection (Bool). Share connection between threads.
        • table (Required)(String). MySQL table name.
        • user (Required)(String). Default user for replicas.
        • where (String). WHERE clause for selecting rows.
      • postgresql_source [Block]. PostgreSQL source for the external dictionary.
        • db (Required)(String). PostgreSQL database name.
        • hosts (Required)(List Of String). PostgreSQL hosts.
        • invalidate_query (String). Query to check if the dictionary data has changed.
        • password (String). PostgreSQL password.
        • port (Number). PostgreSQL port. Defaults to 5432 if not specified.
        • ssl_mode (String). SSL mode for the PostgreSQL connection (DISABLE, ALLOW, PREFER, VERIFY_CA, VERIFY_FULL).
        • table (Required)(String). PostgreSQL table name.
        • user (Required)(String). PostgreSQL user.
    • structure [Block]. Structure of the external dictionary.
      • attributes [Block]. Dictionary attributes.
        • expression (String). Expression for computing the attribute.
        • hierarchical (Bool). Is the attribute hierarchical.
        • injective (Bool). Is the attribute injective.
        • name (Required)(String). Attribute name.
        • null_value (String). Default value for null.
        • type (Required)(String). Attribute type.
      • id [Block]. Single numeric key column for the dictionary.
        • name (Required)(String). Name of the numeric key column.
      • key [Block]. Composite key for the dictionary.
        • attributes [Block]. Key attributes.
          • expression (String). Expression for computing the attribute.
          • hierarchical (Bool). Is the attribute hierarchical.
          • injective (Bool). Is the attribute injective.
          • name (Required)(String). Attribute name.
          • null_value (String). Default value for null.
          • type (Required)(String). Attribute type.
      • range_max [Block]. Field holding the end of the range for RANGE_HASHED layout.
        • expression (String). Expression for computing the attribute.
        • hierarchical (Bool). Is the attribute hierarchical.
        • injective (Bool). Is the attribute injective.
        • name (Required)(String). Attribute name.
        • null_value (String). Default value for null.
        • type (Required)(String). Attribute type.
      • range_min [Block]. Field holding the beginning of the range for RANGE_HASHED layout.
        • expression (String). Expression for computing the attribute.
        • hierarchical (Bool). Is the attribute hierarchical.
        • injective (Bool). Is the attribute injective.
        • name (Required)(String). Attribute name.
        • null_value (String). Default value for null.
        • type (Required)(String). Attribute type.
  • folder_id (String). The folder identifier that resource belongs to. If it is not provided, the default provider folder-id is used.
  • full_version (Read-Only) (String). Full version of the ClickHouse server software.
  • hosts [Block]. A host configuration of the ClickHouse cluster.
    • assign_public_ip (Bool). Whether the host should get a public IP address.
    • fqdn (Read-Only) (String). The fully qualified domain name of the host.
    • shard_name (String). The name of the shard to which the host belongs.
    • subnet_id (String). ID of the subnet where the host is located.
    • type (Required)(String). The type of the host to be deployed. Can be either CLICKHOUSE or ZOOKEEPER.
    • zone (Required)(String). The availability zone where resource is located. If it is not provided, the default provider zone will be used.
  • id (Read-Only) (String). The resource identifier.
  • labels (Map Of String). A set of key/value label pairs which assigned to resource.
  • monitoring [Block]. Description of monitoring systems relevant to the ClickHouse cluster.
    • description (Read-Only) (String). Description of the monitoring system.
    • link (Read-Only) (String). Link to the monitoring system charts for the ClickHouse cluster.
    • name (Read-Only) (String). Name of the monitoring system.
  • name (Required)(String). Name of the ClickHouse cluster. Provided by the client when the cluster is created.
  • network_id (Required)(String). The VPC Network ID of subnets which resource attached to.
  • performance_diagnostics [Block]. Performance diagnostics configuration
    • enabled (Bool). Enabled performance diagnostics.
    • processes_refresh_interval (String). Refresh interval for performance diagnostics data. Specify the value duration format, for example "15s", "1m0s", or "1h0m0s".
  • restore [Block]. The cluster will be created from the specified backup.
    • backup_id (Required)(String). Backup ID. The cluster will be created from the specified backup.
    • exclude_patterns (List Of String). Tables and databases to exclude from restore.
    • include_patterns (List Of String). Tables and databases to include in restore.
  • security_group_ids (Set Of String). The list of security groups applied to resource or their components.
  • service_account_id (String). Service account which linked to the resource.
  • shards [Block]. A shards of the ClickHouse cluster.
    • disk_size_autoscaling [Block]. Cluster disk size autoscaling settings.
      • disk_size_limit (Required)(Number). The overall maximum for disk size that limit all autoscaling iterations. See the documentation for details.
      • emergency_usage_threshold (Number). Threshold of storage usage (in percent) that triggers immediate automatic scaling of the storage. Zero value means disabled threshold.
      • planned_usage_threshold (Number). Threshold of storage usage (in percent) that triggers automatic scaling of the storage during the maintenance window. Zero value means disabled threshold.
    • resources [Block]. Resources allocated to hosts.
      • disk_size (Number). Volume of the storage available to a host, in gigabytes.
      • disk_type_id (String). Type of the storage of hosts. For more information see the official documentation.
      • resource_preset_id (String). The ID of the preset for computational resources available to a host (CPU, memory etc.). For more information, see the official documentation.
    • weight (Number). The weight of shard.
  • sql_database_management (Bool). Grants admin user database management permission.
  • sql_user_management (Bool). Enables admin user with user management permission.
  • timeouts [Block].
    • create (String). A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    • delete (String). A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    • update (String). A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
  • version (String). Version of the ClickHouse server software.
  • zookeeper [Block]. Configuration of the ZooKeeper subcluster.
    • disk_size_autoscaling [Block]. Cluster disk size autoscaling settings.
      • disk_size_limit (Required)(Number). The overall maximum for disk size that limit all autoscaling iterations. See the documentation for details.
      • emergency_usage_threshold (Number). Threshold of storage usage (in percent) that triggers immediate automatic scaling of the storage. Zero value means disabled threshold.
      • planned_usage_threshold (Number). Threshold of storage usage (in percent) that triggers automatic scaling of the storage during the maintenance window. Zero value means disabled threshold.
    • resources [Block]. Resources allocated to hosts.
      • disk_size (Number). Volume of the storage available to a host, in gigabytes.
      • disk_type_id (String). Type of the storage of hosts. For more information see the official documentation.
      • resource_preset_id (String). The ID of the preset for computational resources available to a host (CPU, memory etc.). For more information, see the official documentation.
  • extension [Block]. A set of cluster extensions.
    • name (Required)(String). The name of the extension.
    • version (String). Version of the extension.
  • format_schema [Block]. A set of protobuf or capnproto format schemas.
    • name (Required)(String). The name of the format schema.
    • type (Required)(String). Type of the format schema.
    • uri (Required)(String). Format schema file URL. You can only use format schemas stored in Yandex Object Storage.
  • maintenance_window [Block]. Maintenance window settings.
    • day (String). Day of week for maintenance window if window type is weekly. Possible values: MON, TUE, WED, THU, FRI, SAT, SUN.
    • hour (Number). Hour of day in UTC time zone (1-24) for maintenance window if window type is weekly.
    • type (Required)(String). Type of maintenance window. Can be either ANYTIME or WEEKLY. A day and hour of window need to be specified with weekly window.
  • ml_model [Block]. A group of machine learning models.
    • name (Required)(String). The name of the ml model.
    • type (Required)(String). Type of the model.
    • uri (Required)(String). Model file URL. You can only use models stored in Yandex Object Storage.
  • shard_group [Block]. A group of clickhouse shards.
    • description (String). Description of the shard group.
    • name (Required)(String). The name of the shard group, used as cluster name in Distributed tables.
    • shard_names (List Of String). List of shards names that belong to the shard group. At least one of shard_names or external_shard must be specified.
    • external_shard [Block]. List of external shards in the shard group. At least one of shard_names or external_shard must be specified.
      • name (Required)(String). Name of the external shard.
      • weight (Number). Relative weight of the external shard considered when writing data.
      • replica [Block]. List of replicas in the external shard.
        • host (Required)(String). Name (FQDN) or IP address of the external replica host.
        • password (String). Password of the user to authenticate with on the external replica.
        • port (Number). Port to connect to the external replica. Defaults to the ClickHouse native port (9000).
        • priority (Number). Priority of the external replica for load balancing. Lower value is preferred.
        • secure (Bool). Whether to use a secure (SSL/TLS) connection.
        • user (String). Name of the user to authenticate with on the external replica.

ImportImport

The resource can be imported by using their resource ID. For getting it you can use Yandex Cloud Web Console or Yandex Cloud CLI.

# terraform import yandex_mdb_clickhouse_cluster_v2.<resource Name> <resource Id>
terraform import yandex_mdb_clickhouse_cluster_v2.my_cluster cluster_id

Была ли статья полезна?

Предыдущая
mdb_clickhouse_cluster_iam_binding
Следующая
mdb_clickhouse_database
Создавайте контент и получайте гранты!Готовы написать своё руководство? Участвуйте в контент-программе и получайте гранты на работу с облачными сервисами!
Подробнее о программе
Проект Яндекса
© 2026 ТОО «Облачные Сервисы Казахстан»