> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ClickHouse와 ZooKeeper 간의 보안 SSL/TLS 통신 구성 가이드

# ClickHouse와 ZooKeeper 간의 선택적 보안 통신

export const CloudNotSupportedBadge = () => {
  return <div className="cloudNotSupportedBadge">
            <div className="cloudNotSupportedIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path strokeWidth="1.5" d="M6.33366 12.6666L12.3739 12.6667C13.6593 12.6667 14.7073 11.6187 14.7073 10.3334C14.7073 9.04804 13.6593 8.00003 12.3739 8.00003C12.3739 8.00003 12.3337 7.66659 12.0003 7.33325M10.667 5.33322C8.00033 2.33325 4.45395 4.78537 4.14195 6.68203C2.55728 6.7627 1.29395 8.06203 1.29395 9.6667C1.29395 11.3234 2.66699 12.6666 4.00033 12.6666" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.5" d="M2.66699 14L12.0003 4.66663" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>

        </div>
            ClickHouse Cloud에서 지원되지 않음
        </div>;
};

<CloudNotSupportedBadge />

<Note>
  이 페이지는 [ClickHouse Cloud](https://clickhouse.com/cloud)에는 해당되지 않습니다. 여기에서 설명하는 절차는 ClickHouse Cloud 서비스에서 자동으로 처리됩니다.
</Note>

SSL을 통해 ClickHouse client와 통신하려면 `ssl.keyStore.location`, `ssl.keyStore.password`, `ssl.trustStore.location`, `ssl.trustStore.password`를 지정해야 합니다. 이러한 옵션은 Zookeeper 3.5.2 버전부터 사용할 수 있습니다.

`zookeeper.crt`를 신뢰된 인증서에 추가할 수 있습니다.

```bash theme={null}
sudo cp zookeeper.crt /usr/local/share/ca-certificates/zookeeper.crt
sudo update-ca-certificates
```

`config.xml`의 클라이언트 섹션은 다음과 같이 표시됩니다:

```xml theme={null}
<client>
    <certificateFile>/etc/clickhouse-server/client.crt</certificateFile>
    <privateKeyFile>/etc/clickhouse-server/client.key</privateKeyFile>
    <loadDefaultCAFile>true</loadDefaultCAFile>
    <cacheSessions>true</cacheSessions>
    <disableProtocols>sslv2,sslv3</disableProtocols>
    <preferServerCiphers>true</preferServerCiphers>
    <invalidCertificateHandler>
        <name>RejectCertificateHandler</name>
    </invalidCertificateHandler>
</client>
```

클러스터와 매크로를 포함하여 ClickHouse 구성에 Zookeeper를 추가합니다:

```xml theme={null}
<clickhouse>
    <zookeeper>
        <node>
            <host>localhost</host>
            <port>2281</port>
            <secure>1</secure>
        </node>
    </zookeeper>
</clickhouse>
```

`clickhouse-server`를 실행하십시오. 로그에 다음이 표시되어야 합니다:

```text theme={null}
<Trace> ZooKeeper: initialized, hosts: secure://localhost:2281
```

접두사 `secure://`는 connection이 SSL로 보호된다는 것을 나타냅니다.

트래픽이 암호화되는지 확인하려면 보안 포트에서 `tcpdump`를 실행하십시오:

```bash theme={null}
tcpdump -i any dst port 2281 -nnXS
```

그리고 `clickhouse-client`에서 쿼리를 실행합니다:

```sql theme={null}
SELECT * FROM system.zookeeper WHERE path = '/';
```

암호화되지 않은 연결에서는 `tcpdump` 출력에 다음과 같은 내용이 표시됩니다:

```text theme={null}
..../zookeeper/quota.
```

암호화된 연결에서는 이 내용이 표시되지 않아야 합니다.
