distributed_ddl 서버 설정

distributed_ddl 서버 설정

이 페이지에서는 클러스터에서 실행되는 분산 DDL 쿼리(CREATE, DROP, ALTER, RENAME)를 관리하는 distributed_ddl 설정을 설명할게요.

출처: 문서

본문

이 설정들은 ClickHouse 서버를 구성하며, ClickHouse 소스에서 자동으로 생성돼요.

distributed_ddl

클러스터에서 실행되는 distributed ddl queries(CREATE, DROP, ALTER, RENAME)를 관리해요. ZooKeeper가 활성화된 경우에만 동작해요.

<distributed_ddl> 안에서 구성 가능한 설정은 다음과 같아요.

Setting Description Default Value
cleanup_delay_period 마지막 정리가 cleanup_delay_period 초 전보다 이르지 않게 수행된 경우, 새 노드 이벤트를 받으면 정리가 시작돼요. 60 seconds
max_tasks_in_queue 큐에 있을 수 있는 최대 작업 수예요. 1,000
path DDL 쿼리의 task_queue에 대한 Keeper의 경로예요.
pool_size ON CLUSTER 쿼리를 동시에 몇 개 실행할 수 있는지예요.
profile DDL 쿼리를 실행하는 데 사용되는 프로필이에요.
task_max_lifetime 노드의 나이가 이 값보다 크면 노드를 삭제해요. 7 * 24 * 60 * 60 (1주일(초))

예시

<distributed_ddl>
    <!-- Path in ZooKeeper to queue with DDL queries -->
    <path>/clickhouse/task_queue/ddl</path>

    <!-- Settings from this profile will be used to execute DDL queries -->
    <profile>default</profile>

    <!-- Controls how much ON CLUSTER queries can be run simultaneously. -->
    <pool_size>1</pool_size>

    <!--
         Cleanup settings (active tasks will not be removed)
    -->

    <!-- Controls task TTL (default 1 week) -->
    <task_max_lifetime>604800</task_max_lifetime>

    <!-- Controls how often cleanup should be performed (in seconds) -->
    <cleanup_delay_period>60</cleanup_delay_period>

    <!-- Controls how many tasks could be in the queue -->
    <max_tasks_in_queue>1000</max_tasks_in_queue>
</distributed_ddl>

distributed_ddl_use_initial_user_and_roles

활성화하면 ON CLUSTER 쿼리가 원격 샤드에서 실행할 때 개시자(initiator)의 사용자와 역할을 보존하여 사용해요. 이는 클러스터 전반에 걸쳐 일관된 접근 제어를 보장하지만, 해당 사용자와 역할이 모든 노드에 존재해야 해요.

더 알아보기 (Learn more)