...
скопируйте секции
clickhouse-1
иjdbc-bridge-1
в количестве, равном количеству ваших серверов. В скопированных секциях необходимо заменить все единицы (1
) на2
,3
,4
и т.д.
Пример (надо заменить цифры в строках 1, 24, 34, 4344, 4546, 5556, 6466):
Блок кода | ||
---|---|---|
| ||
clickhouse-2: # Use clickhouse/clickhouse-server:23.3.4.17-alpine image: ${DOCKER_REPO_PREFIX}${CHCLICKHOUSE_TAG} ulimits: nofile: soft: 262144 hard: 262144 configs: - source: clickhousejdbcbridge target: /etc/clickhouse-server/config.d/clickhouse-jdbc-bridge.xml - source: clickhousedisabledroplimits target: /etc/clickhouse-server/config.d/clickhouse-disable-drop-limits.xml - source: clickhousetimezone target: /etc/clickhouse-server/config.d/clickhouse-timezone.xml - source: clickhousequerymaskingrulesforjdbc target: /etc/clickhouse-server/config.d/clickhouse-query-masking-rules-for-jdbc.xml - source: clickhouseentrypoint target: /entrypoint.sh mode: 0555 environment: CLICKHOUSE_DB: ${CLICKHOUSE_DB} CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1 CLICKHOUSE_INIT_TIMEOUT: 600 JDBC_BRIDGE_HOST: ${JDBC_BRIDGE_HOST_2} secrets: - source: CLICKHOUSE_FE_USER target: CLICKHOUSE_USER - source: CLICKHOUSE_FE_PASSWORD target: CLICKHOUSE_PASSWORD volumes: - clickhouse_data:/var/lib/clickhouse << : [*logging-options] labels: component: "v3-clickhouse-2" networks: visiology-3: smart-forms-share: deploy: endpoint_mode: dnsrr replicas: 1 placement: max_replicas_per_node: 1 constraints: - "node.labels.v3-clickhouse-2==true" jdbc-bridge-2: # Use clickhousecr.yandex/crpe1mi33uplrq7coc9d/visiology/release/original/jdbc-bridge:23.1.06 image: ${DOCKER_REPO_PREFIX}${JBJDBC_BRIDGE_TAG} environment: JDBC_BRIDGE_JVM_OPTS: ${JDBC_BRIDGE_MEM_OPTIONS} configs: - source: jdbcbridge target: /app/config/server.json << : [*logging-options] labels: component: "v3-jdbc-bridge-2" networks: visiology-3: smart-forms-share: deploy: endpoint_mode: dnsrr replicas: 1 placement: max_replicas_per_node: 1 constraints: - "node.labels.v3-clickhouse-2==true" |
...
Блок кода |
---|
"clickhouse2": "Compression=True;CheckCompressedHash=False;Compressor=lz4;Host={{ env "CLICKHOUSE_HOST_2" }};Port={{ env "CLICKHOUSE_PORT" }};Username={{ secret "CLICKHOUSE_FE_USER" }};Password={{ secret "CLICKHOUSE_FE_PASSWORD" }};Database={{ env "CLICKHOUSE_DB" }};UseSession=true;Timeout=120;set_max_execution_time=120;set_cancel_http_readonly_queries_on_client_close=1;set_timeout_before_checking_execution_speed=30;", "clickhouse3": "Compression=True;CheckCompressedHash=False;Compressor=lz4;Host={{ env "CLICKHOUSE_HOST_3" }};Port={{ env "CLICKHOUSE_PORT" }};Username={{ secret "CLICKHOUSE_FE_USER" }};Password={{ secret "CLICKHOUSE_FE_PASSWORD" }};Database={{ env "CLICKHOUSE_DB" }};UseSession=true;Timeout=120;set_max_execution_time=120;set_cancel_http_readonly_queries_on_client_close=1;set_timeout_before_checking_execution_speed=30;" ... |
Обратите внимание, что запятые должны быть во всех строках, кроме последней.
...
8. Выполните следующую команду на главном сервере:
Блок кода | ||
---|---|---|
| ||
/var/lib/visiology/scripts/v3/prepare-config.sh --force-regenerate-configs |
...