<?xml version="1.0"?>
<clickhouse>

  <http_port>8123</http_port>
  <tcp_port>9000</tcp_port>
  <interserver_http_port>9009</interserver_http_port>
  <interserver_http_host>clickhouse1</interserver_http_host>

  <users_config>users.xml</users_config>
  <default_profile>default</default_profile>
  <default_database>default</default_database>

  <mark_cache_size>5368709120</mark_cache_size>

  <path>/var/lib/clickhouse/</path>
  <tmp_path>/var/lib/clickhouse/tmp/</tmp_path>
  <user_files_path>/var/lib/clickhouse/user_files/</user_files_path>
  <access_control_path>/var/lib/clickhouse/access/</access_control_path>
  <keep_alive_timeout>3</keep_alive_timeout>

  <logger>
    <level>debug</level>
    <log>/var/log/clickhouse-server/clickhouse-server.log</log>
    <errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
    <size>1000M</size>
    <count>10</count>
    <console>1</console>
  </logger>

  <remote_servers>
    <test_cluster>
      <shard>
        <replica>
          <host>clickhouse1</host>
          <port>9100</port>
        </replica>
        <replica>
          <host>clickhouse2</host>
          <port>9100</port>
        </replica>
      </shard>
    </test_cluster>
  </remote_servers>

  <keeper_server>
    <tcp_port>9181</tcp_port>
    <server_id>1</server_id>
    <log_storage_path>/var/lib/clickhouse/coordination/log</log_storage_path>
    <snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path>

    <coordination_settings>
      <operation_timeout_ms>10000</operation_timeout_ms>
      <session_timeout_ms>30000</session_timeout_ms>
      <raft_logs_level>trace</raft_logs_level>
      <rotate_log_storage_interval>10000</rotate_log_storage_interval>
    </coordination_settings>

    <raft_configuration>
      <server>
        <id>1</id>
        <hostname>clickhouse1</hostname>
        <port>9100</port>
      </server>
      <server>
        <id>2</id>
        <hostname>clickhouse2</hostname>
        <port>9100</port>
      </server>
    </raft_configuration>
  </keeper_server>

  <zookeeper>
    <node>
      <host>clickhouse1</host>
      <port>9181</port>
    </node>
    <node>
      <host>clickhouse2</host>
      <port>9181</port>
    </node>
  </zookeeper>

  <distributed_ddl>
    <path>/clickhouse/test_cluster/task_queue/ddl</path>
  </distributed_ddl>

  <query_log>
    <database>system</database>
    <table>query_log</table>
    <partition_by>toYYYYMM(event_date)</partition_by>
    <flush_interval_milliseconds>1000</flush_interval_milliseconds>
  </query_log>

  <http_options_response>
    <header>
      <name>Access-Control-Allow-Origin</name>
      <value>*</value>
    </header>
    <header>
      <name>Access-Control-Allow-Headers</name>
      <value>accept, origin, x-requested-with, content-type, authorization</value>
    </header>
    <header>
      <name>Access-Control-Allow-Methods</name>
      <value>POST, GET, OPTIONS</value>
    </header>
    <header>
      <name>Access-Control-Max-Age</name>
      <value>86400</value>
    </header>
  </http_options_response>

  <!-- required after 25.1+ -->
  <format_schema_path>/var/lib/clickhouse/format_schemas/</format_schema_path>
  <user_directories>
    <users_xml>
      <path>users.xml</path>
    </users_xml>
  </user_directories>

  <!-- Avoid SERVER_OVERLOADED running many parallel tests after 25.5+ -->
  <os_cpu_busy_time_threshold>1000000000000000000</os_cpu_busy_time_threshold>
</clickhouse>
