...
скопируйте секции
clickhouse-1
иjdbc-bridge-1
в количестве, равном количеству ваших серверов. В скопированных секциях необходимо заменить все единицы (1
) на2
,3
,4
и т.д.
Пример (надо заменить цифры в строках 1, 2430, 3440, 4450, 4652, 5662, 6672):
Блок кода | ||
---|---|---|
| ||
clickhouse-2: # Use clickhouse/clickhouse-server:23.3.4.17-alpine image: ${CLICKHOUSE_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: clickhouselogging target: /etc/clickhouse-server/config.d/clickhouse-logging.xml - source: clickhouseentrypoint target: /entrypoint.sh mode: 0555 # TODO: при обновлении на 3.9 создавать вручную? - source: clickhousecreatedmstemp target: /docker-entrypoint-initdb.d/clickhouse-create-dmstemp.sql environment: CLICKHOUSE_DB: ${CLICKHOUSE_DB} DM_CLICKHOUSE_DB: ${DM_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 cr.yandex/crpe1mi33uplrq7coc9d/visiology/release/original/jdbc-bridge:3.6 image: ${JDBC_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": { "ConnectionString": "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;", "TcpPort": "9000" }, "clickhouse3": { "ConnectionString": "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;", "TcpPort": "9000" }, ... |
...
Примечание |
---|
|
...
|
...
|
В каждой строке нужно поменять цифру на соответствующую в части Host={{ env "CLICKHOUSE_HOST_1" }}
.
...