version: '3' networks: ck_cluster: driver: bridge ipam: config: - subnet: 172.50.0.0/24 services: haproxy: image: haproxy:latest ports: - "9001:9000" volumes: - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg networks: - ck_cluster depends_on: - clickhouse1 - clickhouse2 - clickhouse3 - clickhouse4 zoo1: image: zookeeper:latest expose: - "2181" - "2888" - "3888" environment: ZOO_MY_ID: "1" ZOO_SERVERS: server.1=0.0.0.0:2888:3888;2181 server.2=zoo2:2888:3888;2181 networks: - ck_cluster zoo2: image: zookeeper:latest expose: - "2181" - "2888" - "3888" environment: ZOO_MY_ID: "2" ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=0.0.0.0:2888:3888;2181 networks: - ck_cluster clickhouse1: image: yandex/clickhouse-server:19.15.3.6 expose: - "9000" depends_on: - zoo1 - zoo2 volumes: - ./config_1.xml:/etc/clickhouse-server/config.xml networks: - ck_cluster ulimits: nofile: soft: 262144 hard: 262144 clickhouse2: image: yandex/clickhouse-server:19.15.3.6 expose: - "9000" depends_on: - zoo1 - zoo2 volumes: - ./config_2.xml:/etc/clickhouse-server/config.xml networks: - ck_cluster ulimits: nofile: soft: 262144 hard: 262144 clickhouse3: image: yandex/clickhouse-server:19.15.3.6 expose: - "9000" depends_on: - zoo1 - zoo2 volumes: - ./config_3.xml:/etc/clickhouse-server/config.xml networks: - ck_cluster ulimits: nofile: soft: 262144 hard: 262144 clickhouse4: image: yandex/clickhouse-server:19.15.3.6 expose: - "9000" depends_on: - zoo1 - zoo2 volumes: - ./config_4.xml:/etc/clickhouse-server/config.xml networks: - ck_cluster ulimits: nofile: soft: 262144 hard: 262144