CREATE DICTIONARY ... SOURCE HTTP(S)

CREATE DICTIONARY ... SOURCE HTTP(S)

HTTP(S) 서버 작업은 딕셔너리가 메모리에 저장되는 방식에 따라 달라져요. 딕셔너리가 cachecomplex_key_cache로 저장되면 ClickHouse는 POST 메서드로 요청을 보내 필요한 키를 요청합니다.

출처: 문서

본문

설정 예시:

  • DDL
  • Configuration file
SOURCE(HTTP(
    url 'http://[::1]/os.tsv'
    format 'TabSeparated'
    credentials(user 'user' password 'password')
    headers(header(name 'API-KEY' value 'key'))
))
<source>
    <http>
        <url>http://[::1]/os.tsv</url>
        <format>TabSeparated</format>
        <credentials>
            <user>user</user>
            <password>password</password>
        </credentials>
        <headers>
            <header>
                <name>API-KEY</name>
                <value>key</value>
            </header>
        </headers>
    </http>
</source>

ClickHouse가 HTTPS 리소스에 접근하려면 서버 구성에서 openSSL을 구성해야 해요.

설정 필드:

Setting Description
url 소스 URL이에요.
format 파일 형식이에요. Formats에 설명된 모든 형식이 지원됩니다.
credentials 기본 HTTP 인증이에요. 선택 사항이에요.
user 인증에 필요한 사용자 이름이에요.
password 인증에 필요한 비밀번호예요.
headers HTTP 요청에 사용되는 모든 사용자 지정 HTTP 헤더 항목이에요. 선택 사항이에요.
header 단일 HTTP 헤더 항목이에요.
name 요청에 전송되는 헤더에 사용되는 식별자 이름이에요.
value 특정 식별자 이름에 설정되는 값이에요.

DDL 명령(CREATE DICTIONARY ...)으로 딕셔너리를 만들 때 HTTP 딕셔너리의 원격 호스트는 DB 사용자가 임의 HTTP 서버에 접근하는 것을 막기 위해 config의 remote_url_allow_hosts 섹션 내용과 대조해 확인됩니다.

더 알아보기 (Learn more)