문제 상황
보통 클릭하우스 configuration 파일(config.xml)에서 변수를 변경하면 자동으로 반영이 되지만 xml 파일을 함부로 수정하기엔 문제가 발생할 수 있어 쉽지 않다.
따라서 직접적인 xml 파일 수정 없이 클릭하우스 config를 변경하고, 반영이 잘 되었는지 확인할 방법이 필요했다.
해결 방법
클릭하우스 클라이언트를 이용해 설정할 수 있다.
먼저 클릭하우스 클라이언트의 옵션 정보들을 아래 명령어로 출력할 수 있다.
clickhouse-client --help
이를 출력해보면 아래처럼 다양한 옵션을 설정할 수 있는 것을 확인할 수 있다.
Main options:
--help produce help message
-V [ --version ] print version information and exit
--version-clean print version in machine-readable format and exit
-C [ --config-file ] arg config-file path
--queries-file arg file path with queries to execute; multiple files can be specified
(--queries-file file1 file2...)
-d [ --database ] arg database
--history_file arg path to history file
--query_kind arg (=initial_query) One of initial_query/secondary_query/no_query
--query_id arg query_id
[...]
--allow_experimental_live_view arg Enable LIVE VIEW. Not mature enough.
--live_view_heartbeat_interval arg The heartbeat interval in seconds to indicate live query is alive.
--max_live_view_insert_blocks_before_refresh arg Limit maximum number of inserted blocks after which mergeable blocks are dropped and query is re-executed.
--max_memory_usage arg Maximum memory usage for processing of single query. Zero means unlimited.
[...]
여기서 나는 메모리 이슈가 있었기 때문에 max_memory_usage를 늘려주는 옵션을 이용해 아래와 같이 적용하였다.
clickhouse-client --max_memory_usage 100000000000
위 적용한 결과가 잘 반영되었는지는 system.settings 테이블에서 확인할 수 있다.
SELECT *
FROM system.settings
WHERE name LIKE 'max_memory_usage'
FORMAT Vertical
Query id: 3955a998-03ec-4ff5-93e5-48629bb8d5cf
Row 1:
──────
name: max_memory_usage
value: 100000000000
changed: 1
description: Maximum memory usage for processing of single query. Zero means unlimited.
min: ᴺᵁᴸᴸ
max: ᴺᵁᴸᴸ
readonly: 0
type: UInt64
default: 0
alias_for:
1 row in set. Elapsed: 0.013 sec.
max_memory_usage가 100GB(100,000,000,000)로 잘 반영된 것을 확인할 수 있다.
Reference
'서버 및 환경 > DB' 카테고리의 다른 글
[Dbeaver] postgres 연결 시 전체 데이터베이스가 보이지 않을 때 해결방법 (1) | 2024.02.02 |
---|---|
[PostgreSQL] 쌍콜론 (::, double colon) 의 의미와 CAST 함수 (0) | 2022.11.08 |
[Oracle] Database 연결 시 발생하는 에러 종류 (0) | 2022.10.17 |