> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ClickHouse integration

> 기본 제공되는 CDC 기능을 사용해 Postgres 데이터를 ClickHouse로 복제합니다

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

export const galaxyOnClick = eventName => () => {
  try {
    if (typeof window !== "undefined" && window.galaxy && eventName) {
      window.galaxy.track(eventName, {
        interaction: "click"
      });
    }
  } catch (e) {}
};

export const BetaBadge = ({link, galaxyTrack, galaxyEvent}) => {
  if (link) {
    return <a href={link} target="_blank" rel="noopener noreferrer" className="betaBadge" onClick={galaxyTrack && galaxyEvent ? galaxyOnClick(galaxyEvent) : undefined}>
                <Icon />
                <span>Beta</span>
            </a>;
  }
  return <div className="betaBadge">
            <Icon />
            <span>
                Beta feature. 
                <u>
                    <a href="/docs/beta-and-experimental-features#beta-features">
                        Learn more.
                    </a>
                </u>
            </span>
        </div>;
};

모든 Managed Postgres 인스턴스에는 각 ClickHouse 서비스로 데이터를 복제할 수 있는 CDC 기능이 기본 제공됩니다. 이를 통해 Postgres 인스턴스의 데이터 일부 또는 전체를 ClickHouse로 옮기고, Postgres에서 발생한 데이터 변경 사항을 ClickHouse에 지속적으로 거의 실시간에 가깝게 반영할 수 있습니다. 이 기능은 내부적으로 [ClickPipes](/ko/integrations/clickpipes/home)를 기반으로 동작합니다.

이 기능에 액세스하려면 Postgres 인스턴스의 사이드바에서 **ClickHouse Integration**을 클릭하십시오.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/qT0j4CNmQubVqREl/images/managed-postgres/clickhouse-integration-intro.png?fit=max&auto=format&n=qT0j4CNmQubVqREl&q=85&s=725f49ffaae6f1cc5666e66a8cb2e900" alt="사이드바에 통합 옵션이 표시된 ClickHouse integration 랜딩 페이지" size="md" border width="2682" height="1274" data-path="images/managed-postgres/clickhouse-integration-intro.png" />

<Note>
  계속 진행하기 전에 Postgres 서비스에 ClickPipes 서비스가 액세스할 수 있는지 확인하십시오. 기본적으로는 가능하지만, IP 액세스를 제한한 경우 **ClickHouse 서비스**가 위치한 리전에 따라 [이](/ko/integrations/clickpipes/home#list-of-static-ips) 목록에 있는 일부 원본 IP의 액세스를 허용해야 할 수 있습니다.
</Note>

ClickPipe 설정을 시작하려면 **Replicate data in ClickHouse**를 클릭하십시오.

<Steps>
  <Step>
    ## 복제 서비스 구성

    복제 설정을 입력합니다.

    * **Integration name**: 이 ClickPipe의 이름
    * **ClickHouse service**: 기존 ClickHouse Cloud 서비스를 선택하거나 새로 생성합니다
    * **Postgres database**: 복제할 원본 데이터베이스
    * **Replication method**: 다음 중 하나를 선택합니다.
      * **Initial load + CDC**: 기존 데이터를 가져오고 이후 새 변경 사항이 생기면 테이블을 계속 업데이트합니다(권장)
      * **Initial load only**: 지속적인 업데이트 없이 기존 데이터를 한 번만 snapshot으로 가져옵니다
      * **CDC only**: 초기 snapshot은 건너뛰고 이후 발생하는 새 변경 사항만 캡처합니다

    <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/qT0j4CNmQubVqREl/images/managed-postgres/replication-service-step.png?fit=max&auto=format&n=qT0j4CNmQubVqREl&q=85&s=dfdb6548307e14cbab3bd99f014ae918" alt="통합 이름, 대상 서비스, 복제 방법 옵션을 보여주는 복제 서비스 구성" size="md" border width="2076" height="1290" data-path="images/managed-postgres/replication-service-step.png" />

    계속하려면 **다음**을 클릭하십시오.
  </Step>

  <Step>
    ## 복제할 테이블 선택

    대상 데이터베이스를 선택한 다음 복제할 테이블을 선택합니다.

    * **Destination database**: 기존 ClickHouse 데이터베이스를 선택하거나 새로 생성합니다
    * **Prefix default destination table names with schema name**: 이름 충돌을 방지하기 위해 Postgres 스키마 이름을 접두사로 추가합니다
    * **Preserve NULL values from source**: 기본값으로 변환하지 않고 원본의 NULL 값을 유지합니다
    * **Remove deleted rows during merges**: [ReplacingMergeTree](/ko/reference/engines/table-engines/mergetree-family/replacingmergetree) 테이블에서 백그라운드 머지 중 삭제된 행을 물리적으로 제거합니다

    스키마를 펼쳐 복제할 개별 테이블을 선택하십시오. 대상 테이블 이름과 컬럼 설정도 사용자 지정할 수 있습니다.

    <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/qT0j4CNmQubVqREl/images/managed-postgres/select-tables-step.png?fit=max&auto=format&n=qT0j4CNmQubVqREl&q=85&s=bc98e7efa4ba22f0ee00d452e158daa2" alt="데이터베이스 선택, 복제 옵션, 스키마별로 그룹화된 테이블 선택기를 보여주는 테이블 선택 단계" size="md" border width="2454" height="1804" data-path="images/managed-postgres/select-tables-step.png" />

    복제를 시작하려면 **Replicate data to ClickHouse**를 클릭하십시오.
  </Step>

  <Step>
    ## ClickPipe 모니터링

    ClickPipe가 시작되면 동일한 메뉴에 표시됩니다. 모든 데이터의 초기 snapshot은 테이블 크기에 따라 다소 시간이 걸릴 수 있습니다.

    <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/qT0j4CNmQubVqREl/images/managed-postgres/integration-running.png?fit=max&auto=format&n=qT0j4CNmQubVqREl&q=85&s=9a94e816b4507d6cc67414342cf27a6a" alt="대상 서비스와 status가 표시된 실행 중인 ClickPipe를 보여주는 ClickHouse integration 목록" size="md" border width="2518" height="622" data-path="images/managed-postgres/integration-running.png" />

    자세한 status를 확인하고, 진행 상황을 모니터링하고, 오류를 확인하고, ClickPipe를 관리하려면 통합 이름을 클릭하십시오. ClickPipe가 가질 수 있는 다양한 상태를 이해하려면 [Lifecycle of a Postgres ClickPipe](/ko/integrations/clickpipes/postgres/lifecycle)를 참조하십시오.
  </Step>
</Steps>
